@fusedashlabs/widgets 0.3.1 → 0.4.1

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 (409) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +1 -1
  3. package/dist/components/chart-renderer/element/ui9000-chart-renderer.d.ts +2 -0
  4. package/dist/components/chart-renderer/element/ui9000-chart-renderer.d.ts.map +1 -1
  5. package/dist/components/chart-renderer/element/ui9000-chart-renderer.js +23 -2
  6. package/dist/components/chart-renderer/element/ui9000-chart-renderer.js.map +1 -1
  7. package/dist/components/chart-renderer/lib/registry.d.ts.map +1 -1
  8. package/dist/components/chart-renderer/lib/registry.js +20 -5
  9. package/dist/components/chart-renderer/lib/registry.js.map +1 -1
  10. package/dist/components/chart-renderer/lib/types.d.ts +5 -0
  11. package/dist/components/chart-renderer/lib/types.d.ts.map +1 -1
  12. package/dist/components/donut-chart/element/ui9000-donut-chart.js +1 -1
  13. package/dist/components/donut-chart/element/ui9000-donut-chart.js.map +1 -1
  14. package/dist/components/kpi-widget/element/styles.d.ts.map +1 -1
  15. package/dist/components/kpi-widget/element/styles.js +268 -5
  16. package/dist/components/kpi-widget/element/styles.js.map +1 -1
  17. package/dist/components/kpi-widget/element/ui9000-kpi-widget.d.ts +10 -1
  18. package/dist/components/kpi-widget/element/ui9000-kpi-widget.d.ts.map +1 -1
  19. package/dist/components/kpi-widget/element/ui9000-kpi-widget.js +154 -27
  20. package/dist/components/kpi-widget/element/ui9000-kpi-widget.js.map +1 -1
  21. package/dist/components/kpi-widget/index.d.ts +1 -1
  22. package/dist/components/kpi-widget/index.d.ts.map +1 -1
  23. package/dist/components/kpi-widget/index.js +7 -4
  24. package/dist/components/kpi-widget/lib/extract.d.ts +5 -1
  25. package/dist/components/kpi-widget/lib/extract.d.ts.map +1 -1
  26. package/dist/components/kpi-widget/lib/extract.js +110 -34
  27. package/dist/components/kpi-widget/lib/extract.js.map +1 -1
  28. package/dist/components/kpi-widget/lib/format.d.ts +5 -0
  29. package/dist/components/kpi-widget/lib/format.d.ts.map +1 -1
  30. package/dist/components/kpi-widget/lib/format.js +10 -1
  31. package/dist/components/kpi-widget/lib/format.js.map +1 -1
  32. package/dist/components/kpi-widget/lib/grid.d.ts +5 -0
  33. package/dist/components/kpi-widget/lib/grid.d.ts.map +1 -1
  34. package/dist/components/kpi-widget/lib/grid.js +18 -0
  35. package/dist/components/kpi-widget/lib/grid.js.map +1 -1
  36. package/dist/components/kpi-widget/lib/index.d.ts +5 -5
  37. package/dist/components/kpi-widget/lib/index.d.ts.map +1 -1
  38. package/dist/components/kpi-widget/lib/normalize.d.ts +2 -0
  39. package/dist/components/kpi-widget/lib/normalize.d.ts.map +1 -1
  40. package/dist/components/kpi-widget/lib/normalize.js +73 -12
  41. package/dist/components/kpi-widget/lib/normalize.js.map +1 -1
  42. package/dist/components/kpi-widget/lib/types.d.ts +41 -0
  43. package/dist/components/kpi-widget/lib/types.d.ts.map +1 -1
  44. package/dist/components/kpi-widget/metadata.json.d.ts +1 -1
  45. package/dist/components/kpi-widget/metadata.json.js +1 -1
  46. package/dist/components/lollipop/element/styles.d.ts.map +1 -1
  47. package/dist/components/lollipop/element/styles.js +19 -1
  48. package/dist/components/lollipop/element/styles.js.map +1 -1
  49. package/dist/components/lollipop/element/ui9000-lollipop.d.ts +6 -1
  50. package/dist/components/lollipop/element/ui9000-lollipop.d.ts.map +1 -1
  51. package/dist/components/lollipop/element/ui9000-lollipop.js +68 -7
  52. package/dist/components/lollipop/element/ui9000-lollipop.js.map +1 -1
  53. package/dist/components/lollipop/index.d.ts +1 -1
  54. package/dist/components/lollipop/index.d.ts.map +1 -1
  55. package/dist/components/lollipop/index.js +2 -0
  56. package/dist/components/lollipop/index.js.map +1 -1
  57. package/dist/components/lollipop/lib/domain.d.ts +16 -1
  58. package/dist/components/lollipop/lib/domain.d.ts.map +1 -1
  59. package/dist/components/lollipop/lib/domain.js +56 -1
  60. package/dist/components/lollipop/lib/domain.js.map +1 -1
  61. package/dist/components/lollipop/lib/index.d.ts +3 -2
  62. package/dist/components/lollipop/lib/index.d.ts.map +1 -1
  63. package/dist/components/lollipop/lib/layout.d.ts +16 -0
  64. package/dist/components/lollipop/lib/layout.d.ts.map +1 -0
  65. package/dist/components/lollipop/lib/layout.js +16 -0
  66. package/dist/components/lollipop/lib/layout.js.map +1 -0
  67. package/dist/components/lollipop/lib/types.d.ts +5 -0
  68. package/dist/components/lollipop/lib/types.d.ts.map +1 -1
  69. package/dist/components/lollipop/metadata.json.d.ts +10 -0
  70. package/dist/components/lollipop/metadata.json.js +4 -1
  71. package/dist/components/lollipop/metadata.json.js.map +1 -1
  72. package/dist/components/lollipop/render/draw.d.ts +8 -1
  73. package/dist/components/lollipop/render/draw.d.ts.map +1 -1
  74. package/dist/components/lollipop/render/draw.js +155 -84
  75. package/dist/components/lollipop/render/draw.js.map +1 -1
  76. package/dist/components/map-chart/element/styles.d.ts +2 -0
  77. package/dist/components/map-chart/element/styles.d.ts.map +1 -0
  78. package/dist/components/map-chart/element/styles.js +372 -0
  79. package/dist/components/map-chart/element/styles.js.map +1 -0
  80. package/dist/components/map-chart/element/ui9000-map-chart.d.ts +54 -0
  81. package/dist/components/map-chart/element/ui9000-map-chart.d.ts.map +1 -0
  82. package/dist/components/map-chart/element/ui9000-map-chart.js +539 -0
  83. package/dist/components/map-chart/element/ui9000-map-chart.js.map +1 -0
  84. package/dist/components/map-chart/index.d.ts +5 -0
  85. package/dist/components/map-chart/index.d.ts.map +1 -0
  86. package/dist/components/map-chart/index.js +29 -0
  87. package/dist/components/map-chart/index.js.map +1 -0
  88. package/dist/components/map-chart/lib/constants.d.ts +34 -0
  89. package/dist/components/map-chart/lib/constants.d.ts.map +1 -0
  90. package/dist/components/map-chart/lib/constants.js +122 -0
  91. package/dist/components/map-chart/lib/constants.js.map +1 -0
  92. package/dist/components/map-chart/lib/domain.d.ts +12 -0
  93. package/dist/components/map-chart/lib/domain.d.ts.map +1 -0
  94. package/dist/components/map-chart/lib/domain.js +105 -0
  95. package/dist/components/map-chart/lib/domain.js.map +1 -0
  96. package/dist/components/map-chart/lib/format.d.ts +8 -0
  97. package/dist/components/map-chart/lib/format.d.ts.map +1 -0
  98. package/dist/components/map-chart/lib/format.js +45 -0
  99. package/dist/components/map-chart/lib/format.js.map +1 -0
  100. package/dist/components/map-chart/lib/geo-index.d.ts +7 -0
  101. package/dist/components/map-chart/lib/geo-index.d.ts.map +1 -0
  102. package/dist/components/map-chart/lib/geo-index.js +200 -0
  103. package/dist/components/map-chart/lib/geo-index.js.map +1 -0
  104. package/dist/components/map-chart/lib/geojson.d.ts +5 -0
  105. package/dist/components/map-chart/lib/geojson.d.ts.map +1 -0
  106. package/dist/components/map-chart/lib/geojson.js +47 -0
  107. package/dist/components/map-chart/lib/geojson.js.map +1 -0
  108. package/dist/components/map-chart/lib/index.d.ts +13 -0
  109. package/dist/components/map-chart/lib/index.d.ts.map +1 -0
  110. package/dist/components/map-chart/lib/join.d.ts +7 -0
  111. package/dist/components/map-chart/lib/join.d.ts.map +1 -0
  112. package/dist/components/map-chart/lib/join.js +156 -0
  113. package/dist/components/map-chart/lib/join.js.map +1 -0
  114. package/dist/components/map-chart/lib/legend.d.ts +45 -0
  115. package/dist/components/map-chart/lib/legend.d.ts.map +1 -0
  116. package/dist/components/map-chart/lib/legend.js +108 -0
  117. package/dist/components/map-chart/lib/legend.js.map +1 -0
  118. package/dist/components/map-chart/lib/normalize.d.ts +3 -0
  119. package/dist/components/map-chart/lib/normalize.d.ts.map +1 -0
  120. package/dist/components/map-chart/lib/normalize.js +177 -0
  121. package/dist/components/map-chart/lib/normalize.js.map +1 -0
  122. package/dist/components/map-chart/lib/pmtiles.d.ts +41 -0
  123. package/dist/components/map-chart/lib/pmtiles.d.ts.map +1 -0
  124. package/dist/components/map-chart/lib/pmtiles.js +112 -0
  125. package/dist/components/map-chart/lib/pmtiles.js.map +1 -0
  126. package/dist/components/map-chart/lib/types.d.ts +128 -0
  127. package/dist/components/map-chart/lib/types.d.ts.map +1 -0
  128. package/dist/components/map-chart/metadata.json.d.ts +83 -0
  129. package/dist/components/map-chart/metadata.json.js +42 -0
  130. package/dist/components/map-chart/metadata.json.js.map +1 -0
  131. package/dist/components/map-chart/render/draw.d.ts +24 -0
  132. package/dist/components/map-chart/render/draw.d.ts.map +1 -0
  133. package/dist/components/map-chart/render/draw.js +456 -0
  134. package/dist/components/map-chart/render/draw.js.map +1 -0
  135. package/dist/components/map-chart/render/index.d.ts +2 -0
  136. package/dist/components/map-chart/render/index.d.ts.map +1 -0
  137. package/dist/components/matrix-chart/element/styles.d.ts +2 -0
  138. package/dist/components/matrix-chart/element/styles.d.ts.map +1 -0
  139. package/dist/components/matrix-chart/element/styles.js +97 -0
  140. package/dist/components/matrix-chart/element/styles.js.map +1 -0
  141. package/dist/components/matrix-chart/element/ui9000-matrix-chart.d.ts +39 -0
  142. package/dist/components/matrix-chart/element/ui9000-matrix-chart.d.ts.map +1 -0
  143. package/dist/components/matrix-chart/element/ui9000-matrix-chart.js +238 -0
  144. package/dist/components/matrix-chart/element/ui9000-matrix-chart.js.map +1 -0
  145. package/dist/components/matrix-chart/index.d.ts +5 -0
  146. package/dist/components/matrix-chart/index.d.ts.map +1 -0
  147. package/dist/components/matrix-chart/index.js +20 -0
  148. package/dist/components/matrix-chart/lib/domain.d.ts +7 -0
  149. package/dist/components/matrix-chart/lib/domain.d.ts.map +1 -0
  150. package/dist/components/matrix-chart/lib/domain.js +58 -0
  151. package/dist/components/matrix-chart/lib/domain.js.map +1 -0
  152. package/dist/components/matrix-chart/lib/format.d.ts +5 -0
  153. package/dist/components/matrix-chart/lib/format.d.ts.map +1 -0
  154. package/dist/components/matrix-chart/lib/format.js +16 -0
  155. package/dist/components/matrix-chart/lib/format.js.map +1 -0
  156. package/dist/components/matrix-chart/lib/index.d.ts +5 -0
  157. package/dist/components/matrix-chart/lib/index.d.ts.map +1 -0
  158. package/dist/components/matrix-chart/lib/normalize.d.ts +5 -0
  159. package/dist/components/matrix-chart/lib/normalize.d.ts.map +1 -0
  160. package/dist/components/matrix-chart/lib/normalize.js +165 -0
  161. package/dist/components/matrix-chart/lib/normalize.js.map +1 -0
  162. package/dist/components/matrix-chart/lib/types.d.ts +33 -0
  163. package/dist/components/matrix-chart/lib/types.d.ts.map +1 -0
  164. package/dist/components/matrix-chart/metadata.json.d.ts +110 -0
  165. package/dist/components/matrix-chart/metadata.json.js +42 -0
  166. package/dist/components/matrix-chart/metadata.json.js.map +1 -0
  167. package/dist/components/matrix-chart/render/draw.d.ts +63 -0
  168. package/dist/components/matrix-chart/render/draw.d.ts.map +1 -0
  169. package/dist/components/matrix-chart/render/draw.js +225 -0
  170. package/dist/components/matrix-chart/render/draw.js.map +1 -0
  171. package/dist/components/matrix-chart/render/index.d.ts +2 -0
  172. package/dist/components/matrix-chart/render/index.d.ts.map +1 -0
  173. package/dist/components/network-graph/element/styles.d.ts.map +1 -1
  174. package/dist/components/network-graph/element/styles.js +177 -57
  175. package/dist/components/network-graph/element/styles.js.map +1 -1
  176. package/dist/components/network-graph/element/ui9000-network-graph.d.ts +4 -0
  177. package/dist/components/network-graph/element/ui9000-network-graph.d.ts.map +1 -1
  178. package/dist/components/network-graph/element/ui9000-network-graph.js +116 -39
  179. package/dist/components/network-graph/element/ui9000-network-graph.js.map +1 -1
  180. package/dist/components/network-graph/lib/domain.d.ts +2 -2
  181. package/dist/components/network-graph/lib/domain.js.map +1 -1
  182. package/dist/components/network-graph/lib/index.d.ts +1 -0
  183. package/dist/components/network-graph/lib/index.d.ts.map +1 -1
  184. package/dist/components/network-graph/lib/legend.d.ts +15 -0
  185. package/dist/components/network-graph/lib/legend.d.ts.map +1 -0
  186. package/dist/components/network-graph/lib/legend.js +35 -0
  187. package/dist/components/network-graph/lib/legend.js.map +1 -0
  188. package/dist/components/network-graph/render/draw.d.ts +4 -1
  189. package/dist/components/network-graph/render/draw.d.ts.map +1 -1
  190. package/dist/components/network-graph/render/draw.js +34 -9
  191. package/dist/components/network-graph/render/draw.js.map +1 -1
  192. package/dist/components/partial-dependence-chart/element/styles.d.ts +2 -0
  193. package/dist/components/partial-dependence-chart/element/styles.d.ts.map +1 -0
  194. package/dist/components/partial-dependence-chart/element/styles.js +48 -0
  195. package/dist/components/partial-dependence-chart/element/styles.js.map +1 -0
  196. package/dist/components/partial-dependence-chart/element/ui9000-partial-dependence-chart.d.ts +30 -0
  197. package/dist/components/partial-dependence-chart/element/ui9000-partial-dependence-chart.d.ts.map +1 -0
  198. package/dist/components/partial-dependence-chart/element/ui9000-partial-dependence-chart.js +163 -0
  199. package/dist/components/partial-dependence-chart/element/ui9000-partial-dependence-chart.js.map +1 -0
  200. package/dist/components/partial-dependence-chart/index.d.ts +5 -0
  201. package/dist/components/partial-dependence-chart/index.d.ts.map +1 -0
  202. package/dist/components/partial-dependence-chart/index.js +18 -0
  203. package/dist/components/partial-dependence-chart/index.js.map +1 -0
  204. package/dist/components/partial-dependence-chart/lib/domain.d.ts +6 -0
  205. package/dist/components/partial-dependence-chart/lib/domain.d.ts.map +1 -0
  206. package/dist/components/partial-dependence-chart/lib/domain.js +16 -0
  207. package/dist/components/partial-dependence-chart/lib/domain.js.map +1 -0
  208. package/dist/components/partial-dependence-chart/lib/index.d.ts +5 -0
  209. package/dist/components/partial-dependence-chart/lib/index.d.ts.map +1 -0
  210. package/dist/components/partial-dependence-chart/lib/normalize.d.ts +4 -0
  211. package/dist/components/partial-dependence-chart/lib/normalize.d.ts.map +1 -0
  212. package/dist/components/partial-dependence-chart/lib/normalize.js +167 -0
  213. package/dist/components/partial-dependence-chart/lib/normalize.js.map +1 -0
  214. package/dist/components/partial-dependence-chart/lib/series.d.ts +15 -0
  215. package/dist/components/partial-dependence-chart/lib/series.d.ts.map +1 -0
  216. package/dist/components/partial-dependence-chart/lib/series.js +63 -0
  217. package/dist/components/partial-dependence-chart/lib/series.js.map +1 -0
  218. package/dist/components/partial-dependence-chart/lib/types.d.ts +50 -0
  219. package/dist/components/partial-dependence-chart/lib/types.d.ts.map +1 -0
  220. package/dist/components/partial-dependence-chart/metadata.json.d.ts +80 -0
  221. package/dist/components/partial-dependence-chart/metadata.json.js +42 -0
  222. package/dist/components/partial-dependence-chart/metadata.json.js.map +1 -0
  223. package/dist/components/partial-dependence-chart/render/draw.d.ts +34 -0
  224. package/dist/components/partial-dependence-chart/render/draw.d.ts.map +1 -0
  225. package/dist/components/partial-dependence-chart/render/draw.js +95 -0
  226. package/dist/components/partial-dependence-chart/render/draw.js.map +1 -0
  227. package/dist/components/partial-dependence-chart/render/index.d.ts +2 -0
  228. package/dist/components/partial-dependence-chart/render/index.d.ts.map +1 -0
  229. package/dist/components/pie-chart/element/styles.d.ts.map +1 -1
  230. package/dist/components/pie-chart/element/styles.js +34 -1
  231. package/dist/components/pie-chart/element/styles.js.map +1 -1
  232. package/dist/components/pie-chart/element/ui9000-pie-chart.d.ts +0 -2
  233. package/dist/components/pie-chart/element/ui9000-pie-chart.d.ts.map +1 -1
  234. package/dist/components/pie-chart/element/ui9000-pie-chart.js +2 -8
  235. package/dist/components/pie-chart/element/ui9000-pie-chart.js.map +1 -1
  236. package/dist/components/pie-chart/metadata.json.d.ts +1 -7
  237. package/dist/components/pie-chart/metadata.json.js +2 -2
  238. package/dist/components/polar-area-chart/element/styles.d.ts +1 -1
  239. package/dist/components/polar-area-chart/element/styles.d.ts.map +1 -1
  240. package/dist/components/{donut-group-chart → polar-area-chart}/element/styles.js +9 -27
  241. package/dist/components/polar-area-chart/element/styles.js.map +1 -0
  242. package/dist/components/polar-area-chart/element/ui9000-polar-area-chart.d.ts.map +1 -1
  243. package/dist/components/polar-area-chart/element/ui9000-polar-area-chart.js +4 -3
  244. package/dist/components/polar-area-chart/element/ui9000-polar-area-chart.js.map +1 -1
  245. package/dist/components/polar-area-chart/index.d.ts +1 -1
  246. package/dist/components/polar-area-chart/index.d.ts.map +1 -1
  247. package/dist/components/polar-area-chart/index.js +2 -1
  248. package/dist/components/polar-area-chart/lib/domain.d.ts +8 -0
  249. package/dist/components/polar-area-chart/lib/domain.d.ts.map +1 -1
  250. package/dist/components/polar-area-chart/lib/domain.js +20 -0
  251. package/dist/components/polar-area-chart/lib/domain.js.map +1 -1
  252. package/dist/components/polar-area-chart/lib/index.d.ts +1 -1
  253. package/dist/components/polar-area-chart/lib/index.d.ts.map +1 -1
  254. package/dist/components/polar-area-chart/lib/normalize.d.ts.map +1 -1
  255. package/dist/components/polar-area-chart/lib/normalize.js +72 -6
  256. package/dist/components/polar-area-chart/lib/normalize.js.map +1 -1
  257. package/dist/components/polar-area-chart/lib/types.d.ts +6 -1
  258. package/dist/components/polar-area-chart/lib/types.d.ts.map +1 -1
  259. package/dist/components/polar-area-chart/metadata.json.d.ts +1 -1
  260. package/dist/components/polar-area-chart/metadata.json.js +1 -1
  261. package/dist/components/polar-area-chart/render/draw.d.ts.map +1 -1
  262. package/dist/components/polar-area-chart/render/draw.js +2 -2
  263. package/dist/components/polar-area-chart/render/draw.js.map +1 -1
  264. package/dist/components/punchcard-chart/metadata.json.d.ts +1 -1
  265. package/dist/components/punchcard-chart/metadata.json.js +1 -1
  266. package/dist/components/sankey-chart/element/styles.d.ts.map +1 -1
  267. package/dist/components/sankey-chart/element/styles.js +7 -27
  268. package/dist/components/sankey-chart/element/styles.js.map +1 -1
  269. package/dist/components/sankey-chart/element/ui9000-sankey-chart.d.ts +5 -5
  270. package/dist/components/sankey-chart/element/ui9000-sankey-chart.d.ts.map +1 -1
  271. package/dist/components/sankey-chart/element/ui9000-sankey-chart.js +37 -35
  272. package/dist/components/sankey-chart/element/ui9000-sankey-chart.js.map +1 -1
  273. package/dist/components/treemap-chart/element/styles.d.ts +2 -0
  274. package/dist/components/treemap-chart/element/styles.d.ts.map +1 -0
  275. package/dist/components/treemap-chart/element/styles.js +141 -0
  276. package/dist/components/treemap-chart/element/styles.js.map +1 -0
  277. package/dist/components/treemap-chart/element/ui9000-treemap-chart.d.ts +35 -0
  278. package/dist/components/treemap-chart/element/ui9000-treemap-chart.d.ts.map +1 -0
  279. package/dist/components/treemap-chart/element/ui9000-treemap-chart.js +177 -0
  280. package/dist/components/treemap-chart/element/ui9000-treemap-chart.js.map +1 -0
  281. package/dist/components/treemap-chart/index.d.ts +5 -0
  282. package/dist/components/treemap-chart/index.d.ts.map +1 -0
  283. package/dist/components/treemap-chart/index.js +22 -0
  284. package/dist/components/treemap-chart/index.js.map +1 -0
  285. package/dist/components/treemap-chart/lib/color.d.ts +25 -0
  286. package/dist/components/treemap-chart/lib/color.d.ts.map +1 -0
  287. package/dist/components/treemap-chart/lib/color.js +67 -0
  288. package/dist/components/treemap-chart/lib/color.js.map +1 -0
  289. package/dist/components/treemap-chart/lib/format.d.ts +7 -0
  290. package/dist/components/treemap-chart/lib/format.d.ts.map +1 -0
  291. package/dist/components/treemap-chart/lib/format.js +9 -0
  292. package/dist/components/treemap-chart/lib/format.js.map +1 -0
  293. package/dist/components/treemap-chart/lib/index.d.ts +6 -0
  294. package/dist/components/treemap-chart/lib/index.d.ts.map +1 -0
  295. package/dist/components/treemap-chart/lib/layout.d.ts +18 -0
  296. package/dist/components/treemap-chart/lib/layout.d.ts.map +1 -0
  297. package/dist/components/treemap-chart/lib/layout.js +31 -0
  298. package/dist/components/treemap-chart/lib/layout.js.map +1 -0
  299. package/dist/components/treemap-chart/lib/normalize.d.ts +4 -0
  300. package/dist/components/treemap-chart/lib/normalize.d.ts.map +1 -0
  301. package/dist/components/treemap-chart/lib/normalize.js +182 -0
  302. package/dist/components/treemap-chart/lib/normalize.js.map +1 -0
  303. package/dist/components/treemap-chart/lib/types.d.ts +63 -0
  304. package/dist/components/treemap-chart/lib/types.d.ts.map +1 -0
  305. package/dist/components/treemap-chart/metadata.json.d.ts +126 -0
  306. package/dist/components/treemap-chart/metadata.json.js +45 -0
  307. package/dist/components/treemap-chart/render/draw.d.ts +24 -0
  308. package/dist/components/treemap-chart/render/draw.d.ts.map +1 -0
  309. package/dist/components/treemap-chart/render/draw.js +124 -0
  310. package/dist/components/treemap-chart/render/draw.js.map +1 -0
  311. package/dist/components/treemap-chart/render/index.d.ts +2 -0
  312. package/dist/components/treemap-chart/render/index.d.ts.map +1 -0
  313. package/dist/element/chart-legend-render.d.ts +5 -0
  314. package/dist/element/chart-legend-render.d.ts.map +1 -1
  315. package/dist/element/chart-legend-render.js +19 -1
  316. package/dist/element/chart-legend-render.js.map +1 -1
  317. package/dist/element/chart-shell-styles.d.ts.map +1 -1
  318. package/dist/element/chart-shell-styles.js +35 -0
  319. package/dist/element/chart-shell-styles.js.map +1 -1
  320. package/dist/index.d.ts +11 -5
  321. package/dist/index.d.ts.map +1 -1
  322. package/dist/index.js +91 -42
  323. package/dist/index.js.map +1 -1
  324. package/dist/lazy/index.d.ts +5 -2
  325. package/dist/lazy/index.d.ts.map +1 -1
  326. package/dist/lazy/index.js +32 -8
  327. package/dist/lazy/index.js.map +1 -1
  328. package/dist/lazy/map-chart.d.ts +4 -0
  329. package/dist/lazy/map-chart.d.ts.map +1 -0
  330. package/dist/lazy/map-chart.js +5 -0
  331. package/dist/lazy/map-chart.js.map +1 -0
  332. package/dist/lazy/matrix-chart.d.ts +4 -0
  333. package/dist/lazy/matrix-chart.d.ts.map +1 -0
  334. package/dist/lazy/matrix-chart.js +5 -0
  335. package/dist/lazy/matrix-chart.js.map +1 -0
  336. package/dist/lazy/partial-dependence-chart.d.ts +4 -0
  337. package/dist/lazy/partial-dependence-chart.d.ts.map +1 -0
  338. package/dist/lazy/partial-dependence-chart.js +5 -0
  339. package/dist/lazy/partial-dependence-chart.js.map +1 -0
  340. package/dist/lazy/treemap-chart.d.ts +4 -0
  341. package/dist/lazy/treemap-chart.d.ts.map +1 -0
  342. package/dist/lazy/treemap-chart.js +5 -0
  343. package/dist/lazy/treemap-chart.js.map +1 -0
  344. package/dist/utils/axis-units.d.ts +15 -0
  345. package/dist/utils/axis-units.d.ts.map +1 -0
  346. package/dist/utils/axis-units.js +27 -0
  347. package/dist/utils/axis-units.js.map +1 -0
  348. package/dist/utils/chart-helpers.d.ts +6 -6
  349. package/dist/utils/chart-helpers.d.ts.map +1 -1
  350. package/dist/utils/chart-helpers.js +31 -15
  351. package/dist/utils/chart-helpers.js.map +1 -1
  352. package/dist/utils/format-text.d.ts +5 -0
  353. package/dist/utils/format-text.d.ts.map +1 -1
  354. package/dist/utils/format-text.js +7 -0
  355. package/dist/utils/format-text.js.map +1 -1
  356. package/dist/utils/fuse-palette.d.ts +12 -0
  357. package/dist/utils/fuse-palette.d.ts.map +1 -1
  358. package/dist/utils/fuse-palette.js +23 -1
  359. package/dist/utils/fuse-palette.js.map +1 -1
  360. package/dist/utils/fuse-widget.d.ts +13 -4
  361. package/dist/utils/fuse-widget.d.ts.map +1 -1
  362. package/dist/utils/fuse-widget.js.map +1 -1
  363. package/dist/utils/fusedash-visual.d.ts +77 -52
  364. package/dist/utils/fusedash-visual.d.ts.map +1 -1
  365. package/dist/utils/fusedash-visual.js +55 -29
  366. package/dist/utils/fusedash-visual.js.map +1 -1
  367. package/package.json +48 -12
  368. package/dist/components/donut-group-chart/element/styles.d.ts +0 -2
  369. package/dist/components/donut-group-chart/element/styles.d.ts.map +0 -1
  370. package/dist/components/donut-group-chart/element/styles.js.map +0 -1
  371. package/dist/components/donut-group-chart/element/ui9000-donut-group-chart.d.ts +0 -34
  372. package/dist/components/donut-group-chart/element/ui9000-donut-group-chart.d.ts.map +0 -1
  373. package/dist/components/donut-group-chart/element/ui9000-donut-group-chart.js +0 -169
  374. package/dist/components/donut-group-chart/element/ui9000-donut-group-chart.js.map +0 -1
  375. package/dist/components/donut-group-chart/index.d.ts +0 -5
  376. package/dist/components/donut-group-chart/index.d.ts.map +0 -1
  377. package/dist/components/donut-group-chart/index.js +0 -23
  378. package/dist/components/donut-group-chart/lib/domain.d.ts +0 -39
  379. package/dist/components/donut-group-chart/lib/domain.d.ts.map +0 -1
  380. package/dist/components/donut-group-chart/lib/domain.js +0 -51
  381. package/dist/components/donut-group-chart/lib/domain.js.map +0 -1
  382. package/dist/components/donut-group-chart/lib/format.d.ts +0 -7
  383. package/dist/components/donut-group-chart/lib/format.d.ts.map +0 -1
  384. package/dist/components/donut-group-chart/lib/format.js +0 -21
  385. package/dist/components/donut-group-chart/lib/format.js.map +0 -1
  386. package/dist/components/donut-group-chart/lib/index.d.ts +0 -5
  387. package/dist/components/donut-group-chart/lib/index.d.ts.map +0 -1
  388. package/dist/components/donut-group-chart/lib/normalize.d.ts +0 -14
  389. package/dist/components/donut-group-chart/lib/normalize.d.ts.map +0 -1
  390. package/dist/components/donut-group-chart/lib/normalize.js +0 -98
  391. package/dist/components/donut-group-chart/lib/normalize.js.map +0 -1
  392. package/dist/components/donut-group-chart/lib/types.d.ts +0 -49
  393. package/dist/components/donut-group-chart/lib/types.d.ts.map +0 -1
  394. package/dist/components/donut-group-chart/metadata.json.d.ts +0 -113
  395. package/dist/components/donut-group-chart/metadata.json.js +0 -45
  396. package/dist/components/donut-group-chart/render/draw.d.ts +0 -44
  397. package/dist/components/donut-group-chart/render/draw.d.ts.map +0 -1
  398. package/dist/components/donut-group-chart/render/draw.js +0 -194
  399. package/dist/components/donut-group-chart/render/draw.js.map +0 -1
  400. package/dist/components/donut-group-chart/render/index.d.ts +0 -2
  401. package/dist/components/donut-group-chart/render/index.d.ts.map +0 -1
  402. package/dist/components/donut-group-chart/tests/fixtures.d.ts +0 -33
  403. package/dist/components/donut-group-chart/tests/fixtures.d.ts.map +0 -1
  404. package/dist/lazy/donut-group-chart.d.ts +0 -4
  405. package/dist/lazy/donut-group-chart.d.ts.map +0 -1
  406. package/dist/lazy/donut-group-chart.js +0 -5
  407. package/dist/lazy/donut-group-chart.js.map +0 -1
  408. /package/dist/components/{donut-group-chart → matrix-chart}/index.js.map +0 -0
  409. /package/dist/components/{donut-group-chart → treemap-chart}/metadata.json.js.map +0 -0
@@ -0,0 +1,39 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { Ui9000ChartElement } from '../../../element/ui9000-chart-base.js';
3
+ export declare class Ui9000MatrixChart extends Ui9000ChartElement {
4
+ static styles: import('lit').CSSResult[];
5
+ showLegend: boolean;
6
+ showTooltip: boolean;
7
+ private _tooltip;
8
+ private _empty;
9
+ private _pinnedTopAxis;
10
+ private _resizeObserver?;
11
+ private _raf;
12
+ private _drawnSignature;
13
+ private _drawnModel;
14
+ private _modelJson;
15
+ private _model;
16
+ connectedCallback(): void;
17
+ disconnectedCallback(): void;
18
+ firstUpdated(): void;
19
+ updated(changed: PropertyValues): void;
20
+ private scheduleDraw;
21
+ /** Normalizing a dense grid is not free — only redo it when `data` changes. */
22
+ private parseData;
23
+ private draw;
24
+ /**
25
+ * Client tooltip: the row field and its value, then the measure — each
26
+ * carrying the unit declared for that field in `axisDetails`.
27
+ */
28
+ private tooltipRows;
29
+ /** FuseDash `ChartLegend legendType="palette"` — Low → High swatch ramp. */
30
+ private renderPaletteLegend;
31
+ render(): import('lit-html').TemplateResult<1>;
32
+ }
33
+ declare global {
34
+ interface HTMLElementTagNameMap {
35
+ 'ui9000-matrix-chart': Ui9000MatrixChart;
36
+ }
37
+ }
38
+ export declare function registerMatrixChart(): void;
39
+ //# sourceMappingURL=ui9000-matrix-chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui9000-matrix-chart.d.ts","sourceRoot":"","sources":["../../../../src/components/matrix-chart/element/ui9000-matrix-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGzD,OAAO,EAAoB,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAoB7F,qBACa,iBAAkB,SAAQ,kBAAkB;IACvD,OAAgB,MAAM,4BAAoC;IAG1D,UAAU,UAAQ;IAGlB,WAAW,UAAQ;IAGnB,OAAO,CAAC,QAAQ,CAMA;IAGhB,OAAO,CAAC,MAAM,CAAS;IAGvB,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,eAAe,CAAC,CAAiB;IACzC,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,MAAM,CAOZ;IAEO,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IAM5B,YAAY,IAAI,IAAI;IAOpB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAI/C,OAAO,CAAC,YAAY;IAKpB,+EAA+E;IAC/E,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,IAAI;IAoEZ;;;OAGG;IACH,OAAO,CAAC,WAAW;IAoBnB,4EAA4E;IAC5E,OAAO,CAAC,mBAAmB;IAsBlB,MAAM;CAsChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAI1C"}
@@ -0,0 +1,238 @@
1
+ import { nothing, html } from "lit";
2
+ import { property, state, customElement } from "lit/decorators.js";
3
+ import { Ui9000ChartElement } from "../../../element/ui9000-chart-base.js";
4
+ import { readCssVar, CSS_VARS, readThemeFromElement } from "../../../context/widget-context.js";
5
+ import { formatValueWithUnit, axisFieldLabel } from "../../../utils/axis-units.js";
6
+ import { parseJsonAttr, getMatrixDimensions } from "../../../utils/chart-helpers.js";
7
+ import { chartPropsChanged } from "../../../utils/lit-draw.js";
8
+ import { matrixLayout, renderMatrixChart, matrixColorRanges } from "../render/draw.js";
9
+ import { matrixStyles } from "./styles.js";
10
+ import { normalizeMatrixData } from "../lib/normalize.js";
11
+ import { formatCategoryLabel, formatMatrixValue } from "../lib/format.js";
12
+ import { chartShellStyles } from "../../../element/chart-shell-styles.js";
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __decorateClass = (decorators, target, key, kind) => {
16
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
17
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
18
+ if (decorator = decorators[i])
19
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
20
+ if (kind && result) __defProp(target, key, result);
21
+ return result;
22
+ };
23
+ let Ui9000MatrixChart = class extends Ui9000ChartElement {
24
+ constructor() {
25
+ super(...arguments);
26
+ this.showLegend = true;
27
+ this.showTooltip = true;
28
+ this._tooltip = null;
29
+ this._empty = false;
30
+ this._pinnedTopAxis = false;
31
+ this._raf = 0;
32
+ this._drawnSignature = null;
33
+ this._drawnModel = null;
34
+ this._modelJson = null;
35
+ this._model = {
36
+ cells: [],
37
+ xDomain: [],
38
+ yDomain: [],
39
+ rawValues: [],
40
+ categoryKey: "",
41
+ valueKey: ""
42
+ };
43
+ }
44
+ connectedCallback() {
45
+ super.connectedCallback();
46
+ this._resizeObserver = new ResizeObserver(() => this.scheduleDraw());
47
+ this._resizeObserver.observe(this);
48
+ }
49
+ disconnectedCallback() {
50
+ var _a;
51
+ (_a = this._resizeObserver) == null ? void 0 : _a.disconnect();
52
+ cancelAnimationFrame(this._raf);
53
+ super.disconnectedCallback();
54
+ }
55
+ firstUpdated() {
56
+ var _a, _b;
57
+ for (const selector of [".widget-body", ".chart-body", ".chart-scroll"]) {
58
+ const el = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector(selector);
59
+ if (el instanceof HTMLElement) (_b = this._resizeObserver) == null ? void 0 : _b.observe(el);
60
+ }
61
+ }
62
+ updated(changed) {
63
+ if (chartPropsChanged(changed)) this.scheduleDraw();
64
+ }
65
+ scheduleDraw() {
66
+ cancelAnimationFrame(this._raf);
67
+ this._raf = requestAnimationFrame(() => this.draw());
68
+ }
69
+ /** Normalizing a dense grid is not free — only redo it when `data` changes. */
70
+ parseData() {
71
+ if (this._modelJson !== this.dataJson) {
72
+ this._modelJson = this.dataJson;
73
+ this._model = normalizeMatrixData(parseJsonAttr(this.dataJson, []));
74
+ }
75
+ return this._model;
76
+ }
77
+ draw() {
78
+ var _a, _b, _c, _d;
79
+ const chartBody = (_a = this.shadowRoot) == null ? void 0 : _a.querySelector(".chart-body");
80
+ const scroll = (_b = this.shadowRoot) == null ? void 0 : _b.querySelector(".chart-scroll");
81
+ const root = (_c = this.shadowRoot) == null ? void 0 : _c.querySelector(".chart-root");
82
+ const topAxis = (_d = this.shadowRoot) == null ? void 0 : _d.querySelector(".chart-top-axis");
83
+ if (!chartBody || !scroll || !root) return;
84
+ const model = this.parseData();
85
+ this._empty = model.cells.length === 0;
86
+ if (this._empty) {
87
+ root.replaceChildren();
88
+ topAxis == null ? void 0 : topAxis.replaceChildren();
89
+ this._pinnedTopAxis = false;
90
+ this._drawnSignature = null;
91
+ this._drawnModel = null;
92
+ return;
93
+ }
94
+ const { width, margin } = getMatrixDimensions(chartBody);
95
+ const bodyHeight = chartBody.clientHeight || 300;
96
+ const viewportHeight = scroll.clientHeight || 300;
97
+ const themeMode = readCssVar(this, CSS_VARS.mode, "light") === "dark" ? "dark" : "light";
98
+ const signature = [
99
+ width,
100
+ bodyHeight,
101
+ viewportHeight,
102
+ themeMode,
103
+ this.showTooltip
104
+ ].join("|");
105
+ if (this._drawnSignature === signature && this._drawnModel === model) return;
106
+ this._drawnSignature = signature;
107
+ this._drawnModel = model;
108
+ this._pinnedTopAxis = matrixLayout(model, viewportHeight, margin).separateTopAxis;
109
+ renderMatrixChart(root, {
110
+ model,
111
+ width,
112
+ height: viewportHeight,
113
+ bodyHeight,
114
+ margin,
115
+ theme: readThemeFromElement(this),
116
+ themeMode,
117
+ topAxisContainer: topAxis,
118
+ ...this.axisLabelHandlers(),
119
+ onCellHover: this.showTooltip ? ({ cell, event }) => {
120
+ const rect = this.getBoundingClientRect();
121
+ this._tooltip = {
122
+ x: event.clientX - rect.left,
123
+ y: event.clientY - rect.top,
124
+ ...this.tooltipRows(model, cell)
125
+ };
126
+ } : void 0,
127
+ onCellLeave: this.showTooltip ? () => {
128
+ this._tooltip = null;
129
+ } : void 0
130
+ });
131
+ }
132
+ /**
133
+ * Client tooltip: the row field and its value, then the measure — each
134
+ * carrying the unit declared for that field in `axisDetails`.
135
+ */
136
+ tooltipRows(model, cell) {
137
+ var _a, _b;
138
+ const rowValue = formatValueWithUnit(
139
+ formatCategoryLabel(cell.y),
140
+ (_a = model.axisDetails) == null ? void 0 : _a[model.categoryKey]
141
+ );
142
+ const value = formatValueWithUnit(
143
+ formatMatrixValue(cell.value),
144
+ (_b = model.axisDetails) == null ? void 0 : _b[model.valueKey]
145
+ );
146
+ return {
147
+ category: model.categoryKey ? `${axisFieldLabel(model.categoryKey, model.axisDetails)}: ${rowValue}` : rowValue,
148
+ value
149
+ };
150
+ }
151
+ /** FuseDash `ChartLegend legendType="palette"` — Low → High swatch ramp. */
152
+ renderPaletteLegend(model) {
153
+ if (!this.showLegend) return nothing;
154
+ const ranges = matrixColorRanges(model);
155
+ if (!ranges.length) return nothing;
156
+ return html`
157
+ <div class="palette-legend" part="legend">
158
+ <span>Low</span>
159
+ <span class="palette-swatches">
160
+ ${ranges.map(
161
+ (range) => html`<span
162
+ class="palette-swatch"
163
+ style="background:${range.color}"
164
+ title=${`${formatMatrixValue(range.start)} – ${formatMatrixValue(range.end)}`}
165
+ ></span>`
166
+ )}
167
+ </span>
168
+ <span>High</span>
169
+ </div>
170
+ `;
171
+ }
172
+ render() {
173
+ const model = this.parseData();
174
+ return html`
175
+ <div class="widget-shell" part="shell">
176
+ ${this.renderShellHeader(this.headerTitle())}
177
+ <div class="widget-body">
178
+ <div class="chart-body" part="chart-body">
179
+ ${this._empty ? nothing : this.renderPaletteLegend(model)}
180
+ <div
181
+ class="chart-top-axis"
182
+ part="top-axis"
183
+ ?hidden=${!this._pinnedTopAxis}
184
+ ></div>
185
+ <div class="chart-scroll" part="scroll">
186
+ <div
187
+ class="chart-root"
188
+ part="chart"
189
+ ?data-hoverable=${this.showTooltip}
190
+ ?hidden=${this._empty}
191
+ ></div>
192
+ </div>
193
+ </div>
194
+ ${this._empty ? html`<div class="empty" part="empty">No data</div>` : nothing}
195
+ ${this._tooltip ? html`<div
196
+ class="tooltip"
197
+ part="tooltip"
198
+ style="left:${this._tooltip.x}px;top:${this._tooltip.y}px"
199
+ >
200
+ <div class="name">${this._tooltip.category}</div>
201
+ <div>Value: ${this._tooltip.value}</div>
202
+ </div>` : nothing}
203
+ ${this.renderShellLabelTooltip()}
204
+ </div>
205
+ </div>
206
+ `;
207
+ }
208
+ };
209
+ Ui9000MatrixChart.styles = [matrixStyles, chartShellStyles];
210
+ __decorateClass([
211
+ property({ type: Boolean, attribute: "show-legend" })
212
+ ], Ui9000MatrixChart.prototype, "showLegend", 2);
213
+ __decorateClass([
214
+ property({ type: Boolean, attribute: "show-tooltip" })
215
+ ], Ui9000MatrixChart.prototype, "showTooltip", 2);
216
+ __decorateClass([
217
+ state()
218
+ ], Ui9000MatrixChart.prototype, "_tooltip", 2);
219
+ __decorateClass([
220
+ state()
221
+ ], Ui9000MatrixChart.prototype, "_empty", 2);
222
+ __decorateClass([
223
+ state()
224
+ ], Ui9000MatrixChart.prototype, "_pinnedTopAxis", 2);
225
+ Ui9000MatrixChart = __decorateClass([
226
+ customElement("ui9000-matrix-chart")
227
+ ], Ui9000MatrixChart);
228
+ function registerMatrixChart() {
229
+ if (!customElements.get("ui9000-matrix-chart")) {
230
+ customElements.define("ui9000-matrix-chart", Ui9000MatrixChart);
231
+ }
232
+ }
233
+ registerMatrixChart();
234
+ export {
235
+ Ui9000MatrixChart,
236
+ registerMatrixChart
237
+ };
238
+ //# sourceMappingURL=ui9000-matrix-chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui9000-matrix-chart.js","sources":["../../../../src/components/matrix-chart/element/ui9000-matrix-chart.ts"],"sourcesContent":["import { html, nothing, type PropertyValues } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { chartShellStyles, Ui9000ChartElement } from '../../../element/ui9000-chart-base.js';\nimport { CSS_VARS, readCssVar, readThemeFromElement } from '../../../context/widget-context.js';\nimport { axisFieldLabel, formatValueWithUnit } from '../../../utils/axis-units.js';\nimport { getMatrixDimensions, parseJsonAttr } from '../../../utils/chart-helpers.js';\nimport { chartPropsChanged } from '../../../utils/lit-draw.js';\nimport {\n formatCategoryLabel,\n formatMatrixValue,\n normalizeMatrixData,\n type MatrixCell,\n type MatrixInput,\n type MatrixModel,\n} from '../lib/index.js';\nimport {\n matrixColorRanges,\n matrixLayout,\n renderMatrixChart,\n} from '../render/draw.js';\nimport { matrixStyles } from './styles.js';\n\n@customElement('ui9000-matrix-chart')\nexport class Ui9000MatrixChart extends Ui9000ChartElement {\n static override styles = [matrixStyles, chartShellStyles];\n\n @property({ type: Boolean, attribute: 'show-legend' })\n showLegend = true;\n\n @property({ type: Boolean, attribute: 'show-tooltip' })\n showTooltip = true;\n\n @state()\n private _tooltip: {\n x: number;\n y: number;\n /** Client rows: \"<row field>: <row value>\" then \"Value: <measure>\" */\n category: string;\n value: string;\n } | null = null;\n\n @state()\n private _empty = false;\n\n @state()\n private _pinnedTopAxis = false;\n\n private _resizeObserver?: ResizeObserver;\n private _raf = 0;\n private _drawnSignature: string | null = null;\n private _drawnModel: MatrixModel | null = null;\n private _modelJson: string | null = null;\n private _model: MatrixModel = {\n cells: [],\n xDomain: [],\n yDomain: [],\n rawValues: [],\n categoryKey: '',\n valueKey: '',\n };\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._resizeObserver = new ResizeObserver(() => this.scheduleDraw());\n this._resizeObserver.observe(this);\n }\n\n override disconnectedCallback(): void {\n this._resizeObserver?.disconnect();\n cancelAnimationFrame(this._raf);\n super.disconnectedCallback();\n }\n\n override firstUpdated(): void {\n for (const selector of ['.widget-body', '.chart-body', '.chart-scroll']) {\n const el = this.shadowRoot?.querySelector(selector);\n if (el instanceof HTMLElement) this._resizeObserver?.observe(el);\n }\n }\n\n override updated(changed: PropertyValues): void {\n if (chartPropsChanged(changed)) this.scheduleDraw();\n }\n\n private scheduleDraw(): void {\n cancelAnimationFrame(this._raf);\n this._raf = requestAnimationFrame(() => this.draw());\n }\n\n /** Normalizing a dense grid is not free — only redo it when `data` changes. */\n private parseData(): MatrixModel {\n if (this._modelJson !== this.dataJson) {\n this._modelJson = this.dataJson;\n this._model = normalizeMatrixData(parseJsonAttr<MatrixInput>(this.dataJson, []));\n }\n return this._model;\n }\n\n private draw(): void {\n const chartBody = this.shadowRoot?.querySelector('.chart-body') as HTMLElement | null;\n const scroll = this.shadowRoot?.querySelector('.chart-scroll') as HTMLElement | null;\n const root = this.shadowRoot?.querySelector('.chart-root') as HTMLElement | null;\n const topAxis = this.shadowRoot?.querySelector('.chart-top-axis') as HTMLElement | null;\n if (!chartBody || !scroll || !root) return;\n\n const model = this.parseData();\n this._empty = model.cells.length === 0;\n if (this._empty) {\n root.replaceChildren();\n topAxis?.replaceChildren();\n this._pinnedTopAxis = false;\n this._drawnSignature = null;\n this._drawnModel = null;\n return;\n }\n\n const { width, margin } = getMatrixDimensions(chartBody);\n const bodyHeight = chartBody.clientHeight || 300;\n const viewportHeight = scroll.clientHeight || 300;\n const themeMode =\n readCssVar(this, CSS_VARS.mode, 'light') === 'dark' ? 'dark' : 'light';\n\n // Drawing the header changes the scroll viewport, which fires the resize\n // observer again — skip redraws whose inputs are unchanged so that\n // settling costs one extra pass instead of running forever.\n const signature = [\n width,\n bodyHeight,\n viewportHeight,\n themeMode,\n this.showTooltip,\n ].join('|');\n if (this._drawnSignature === signature && this._drawnModel === model) return;\n this._drawnSignature = signature;\n this._drawnModel = model;\n\n this._pinnedTopAxis = matrixLayout(model, viewportHeight, margin).separateTopAxis;\n\n renderMatrixChart(root, {\n model,\n width,\n height: viewportHeight,\n bodyHeight,\n margin,\n theme: readThemeFromElement(this),\n themeMode,\n topAxisContainer: topAxis,\n ...this.axisLabelHandlers(),\n onCellHover: this.showTooltip\n ? ({ cell, event }) => {\n const rect = this.getBoundingClientRect();\n this._tooltip = {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top,\n ...this.tooltipRows(model, cell),\n };\n }\n : undefined,\n onCellLeave: this.showTooltip\n ? () => {\n this._tooltip = null;\n }\n : undefined,\n });\n }\n\n /**\n * Client tooltip: the row field and its value, then the measure — each\n * carrying the unit declared for that field in `axisDetails`.\n */\n private tooltipRows(\n model: MatrixModel,\n cell: MatrixCell,\n ): { category: string; value: string } {\n const rowValue = formatValueWithUnit(\n formatCategoryLabel(cell.y),\n model.axisDetails?.[model.categoryKey],\n );\n const value = formatValueWithUnit(\n formatMatrixValue(cell.value),\n model.axisDetails?.[model.valueKey],\n );\n return {\n category: model.categoryKey\n ? `${axisFieldLabel(model.categoryKey, model.axisDetails)}: ${rowValue}`\n : rowValue,\n value,\n };\n }\n\n /** FuseDash `ChartLegend legendType=\"palette\"` — Low → High swatch ramp. */\n private renderPaletteLegend(model: MatrixModel) {\n if (!this.showLegend) return nothing;\n const ranges = matrixColorRanges(model);\n if (!ranges.length) return nothing;\n return html`\n <div class=\"palette-legend\" part=\"legend\">\n <span>Low</span>\n <span class=\"palette-swatches\">\n ${ranges.map(\n (range) =>\n html`<span\n class=\"palette-swatch\"\n style=\"background:${range.color}\"\n title=${`${formatMatrixValue(range.start)} – ${formatMatrixValue(range.end)}`}\n ></span>`,\n )}\n </span>\n <span>High</span>\n </div>\n `;\n }\n\n override render() {\n const model = this.parseData();\n return html`\n <div class=\"widget-shell\" part=\"shell\">\n ${this.renderShellHeader(this.headerTitle())}\n <div class=\"widget-body\">\n <div class=\"chart-body\" part=\"chart-body\">\n ${this._empty ? nothing : this.renderPaletteLegend(model)}\n <div\n class=\"chart-top-axis\"\n part=\"top-axis\"\n ?hidden=${!this._pinnedTopAxis}\n ></div>\n <div class=\"chart-scroll\" part=\"scroll\">\n <div\n class=\"chart-root\"\n part=\"chart\"\n ?data-hoverable=${this.showTooltip}\n ?hidden=${this._empty}\n ></div>\n </div>\n </div>\n ${this._empty ? html`<div class=\"empty\" part=\"empty\">No data</div>` : nothing}\n ${this._tooltip\n ? html`<div\n class=\"tooltip\"\n part=\"tooltip\"\n style=\"left:${this._tooltip.x}px;top:${this._tooltip.y}px\"\n >\n <div class=\"name\">${this._tooltip.category}</div>\n <div>Value: ${this._tooltip.value}</div>\n </div>`\n : nothing}\n ${this.renderShellLabelTooltip()}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ui9000-matrix-chart': Ui9000MatrixChart;\n }\n}\n\nexport function registerMatrixChart(): void {\n if (!customElements.get('ui9000-matrix-chart')) {\n customElements.define('ui9000-matrix-chart', Ui9000MatrixChart);\n }\n}\n\nregisterMatrixChart();\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ export { Ui9000MatrixChart, registerMatrixChart, } from './element/ui9000-matrix-chart.js';
2
+ export { matrixColorRanges, matrixLayout, renderMatrixChart, } from './render/index.js';
3
+ export { normalizeMatrixData, sortAxisDomain, formatCategoryLabel, formatMatrixValue, type MatrixCell, type MatrixCellsPayload, type MatrixInput, type MatrixModel, } from './lib/index.js';
4
+ export { default as matrixChartMetadata } from './metadata.json';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/matrix-chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { registerMatrixChart } from "./element/ui9000-matrix-chart.js";
2
+ import { Ui9000MatrixChart } from "./element/ui9000-matrix-chart.js";
3
+ import { default as default2 } from "./metadata.json.js";
4
+ import { formatCategoryLabel, formatMatrixValue } from "./lib/format.js";
5
+ import { matrixColorRanges, matrixLayout, renderMatrixChart } from "./render/draw.js";
6
+ import { normalizeMatrixData } from "./lib/normalize.js";
7
+ import { sortAxisDomain } from "./lib/domain.js";
8
+ export {
9
+ Ui9000MatrixChart,
10
+ formatCategoryLabel,
11
+ formatMatrixValue,
12
+ default2 as matrixChartMetadata,
13
+ matrixColorRanges,
14
+ matrixLayout,
15
+ normalizeMatrixData,
16
+ registerMatrixChart,
17
+ renderMatrixChart,
18
+ sortAxisDomain
19
+ };
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Mirrors client `MatrixChart/utils/sortAxisDomain` — axis categories are
3
+ * ordered by detected type (numbers, dates, weekdays, then locale strings),
4
+ * not by `uniqueValues` order.
5
+ */
6
+ export declare function sortAxisDomain(values: (string | number)[]): (string | number)[];
7
+ //# sourceMappingURL=domain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../../../src/components/matrix-chart/lib/domain.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuCH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAC1B,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAsBrB"}
@@ -0,0 +1,58 @@
1
+ const WEEKDAY_ORDER = {
2
+ monday: 0,
3
+ mon: 0,
4
+ tuesday: 1,
5
+ tue: 1,
6
+ wednesday: 2,
7
+ wed: 2,
8
+ thursday: 3,
9
+ thu: 3,
10
+ friday: 4,
11
+ fri: 4,
12
+ saturday: 5,
13
+ sat: 5,
14
+ sunday: 6,
15
+ sun: 6
16
+ };
17
+ function weekdayIndex(value) {
18
+ const key = value.trim().toLowerCase();
19
+ return key in WEEKDAY_ORDER ? WEEKDAY_ORDER[key] : -1;
20
+ }
21
+ function isAllNumeric(values) {
22
+ return values.every((v) => {
23
+ const n = Number(v);
24
+ return String(v).trim() === "" || Number.isFinite(n);
25
+ });
26
+ }
27
+ function isAllDates(values) {
28
+ return values.every((v) => !Number.isNaN(new Date(v).getTime()));
29
+ }
30
+ function isAllWeekdays(values) {
31
+ return values.every((v) => weekdayIndex(String(v)) >= 0);
32
+ }
33
+ function sortAxisDomain(values) {
34
+ const normalized = values.map(
35
+ (v) => typeof v === "number" ? v : String(v ?? "")
36
+ );
37
+ if (!normalized.length) return [];
38
+ if (isAllNumeric(normalized)) {
39
+ return [...normalized].sort((a, b) => Number(a) - Number(b));
40
+ }
41
+ if (isAllDates(normalized)) {
42
+ return [...normalized].sort(
43
+ (a, b) => new Date(a).getTime() - new Date(b).getTime()
44
+ );
45
+ }
46
+ if (isAllWeekdays(normalized)) {
47
+ return [...normalized].sort(
48
+ (a, b) => weekdayIndex(String(a)) - weekdayIndex(String(b))
49
+ );
50
+ }
51
+ return [...normalized].sort(
52
+ (a, b) => String(a).localeCompare(String(b), void 0, { numeric: true })
53
+ );
54
+ }
55
+ export {
56
+ sortAxisDomain
57
+ };
58
+ //# sourceMappingURL=domain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain.js","sources":["../../../../src/components/matrix-chart/lib/domain.ts"],"sourcesContent":["/**\n * Mirrors client `MatrixChart/utils/sortAxisDomain` — axis categories are\n * ordered by detected type (numbers, dates, weekdays, then locale strings),\n * not by `uniqueValues` order.\n */\n\nconst WEEKDAY_ORDER: Record<string, number> = {\n monday: 0,\n mon: 0,\n tuesday: 1,\n tue: 1,\n wednesday: 2,\n wed: 2,\n thursday: 3,\n thu: 3,\n friday: 4,\n fri: 4,\n saturday: 5,\n sat: 5,\n sunday: 6,\n sun: 6,\n};\n\nfunction weekdayIndex(value: string): number {\n const key = value.trim().toLowerCase();\n return key in WEEKDAY_ORDER ? WEEKDAY_ORDER[key] : -1;\n}\n\nfunction isAllNumeric(values: (string | number)[]): boolean {\n return values.every((v) => {\n const n = Number(v);\n return String(v).trim() === '' || Number.isFinite(n);\n });\n}\n\nfunction isAllDates(values: (string | number)[]): boolean {\n return values.every((v) => !Number.isNaN(new Date(v).getTime()));\n}\n\nfunction isAllWeekdays(values: (string | number)[]): boolean {\n return values.every((v) => weekdayIndex(String(v)) >= 0);\n}\n\nexport function sortAxisDomain(\n values: (string | number)[],\n): (string | number)[] {\n const normalized = values.map((v) =>\n typeof v === 'number' ? v : String(v ?? ''),\n );\n if (!normalized.length) return [];\n\n if (isAllNumeric(normalized)) {\n return [...normalized].sort((a, b) => Number(a) - Number(b));\n }\n if (isAllDates(normalized)) {\n return [...normalized].sort(\n (a, b) => new Date(a).getTime() - new Date(b).getTime(),\n );\n }\n if (isAllWeekdays(normalized)) {\n return [...normalized].sort(\n (a, b) => weekdayIndex(String(a)) - weekdayIndex(String(b)),\n );\n }\n return [...normalized].sort((a, b) =>\n String(a).localeCompare(String(b), undefined, { numeric: true }),\n );\n}\n"],"names":[],"mappings":"AAMA,MAAM,gBAAwC;AAAA,EAC5C,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,SAAS;AAAA,EACT,KAAK;AAAA,EACL,WAAW;AAAA,EACX,KAAK;AAAA,EACL,UAAU;AAAA,EACV,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,UAAU;AAAA,EACV,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AACP;AAEA,SAAS,aAAa,OAAuB;AAC3C,QAAM,MAAM,MAAM,KAAA,EAAO,YAAA;AACzB,SAAO,OAAO,gBAAgB,cAAc,GAAG,IAAI;AACrD;AAEA,SAAS,aAAa,QAAsC;AAC1D,SAAO,OAAO,MAAM,CAAC,MAAM;AACzB,UAAM,IAAI,OAAO,CAAC;AAClB,WAAO,OAAO,CAAC,EAAE,KAAA,MAAW,MAAM,OAAO,SAAS,CAAC;AAAA,EACrD,CAAC;AACH;AAEA,SAAS,WAAW,QAAsC;AACxD,SAAO,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,MAAM,IAAI,KAAK,CAAC,EAAE,QAAA,CAAS,CAAC;AACjE;AAEA,SAAS,cAAc,QAAsC;AAC3D,SAAO,OAAO,MAAM,CAAC,MAAM,aAAa,OAAO,CAAC,CAAC,KAAK,CAAC;AACzD;AAEO,SAAS,eACd,QACqB;AACrB,QAAM,aAAa,OAAO;AAAA,IAAI,CAAC,MAC7B,OAAO,MAAM,WAAW,IAAI,OAAO,KAAK,EAAE;AAAA,EAAA;AAE5C,MAAI,CAAC,WAAW,OAAQ,QAAO,CAAA;AAE/B,MAAI,aAAa,UAAU,GAAG;AAC5B,WAAO,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC;AAAA,EAC7D;AACA,MAAI,WAAW,UAAU,GAAG;AAC1B,WAAO,CAAC,GAAG,UAAU,EAAE;AAAA,MACrB,CAAC,GAAG,MAAM,IAAI,KAAK,CAAC,EAAE,QAAA,IAAY,IAAI,KAAK,CAAC,EAAE,QAAA;AAAA,IAAQ;AAAA,EAE1D;AACA,MAAI,cAAc,UAAU,GAAG;AAC7B,WAAO,CAAC,GAAG,UAAU,EAAE;AAAA,MACrB,CAAC,GAAG,MAAM,aAAa,OAAO,CAAC,CAAC,IAAI,aAAa,OAAO,CAAC,CAAC;AAAA,IAAA;AAAA,EAE9D;AACA,SAAO,CAAC,GAAG,UAAU,EAAE;AAAA,IAAK,CAAC,GAAG,MAC9B,OAAO,CAAC,EAAE,cAAc,OAAO,CAAC,GAAG,QAAW,EAAE,SAAS,MAAM;AAAA,EAAA;AAEnE;"}
@@ -0,0 +1,5 @@
1
+ /** Mirrors client `formatNumber` — grouped, up to 3 decimals. */
2
+ export declare function formatMatrixValue(value: number): string;
3
+ /** Mirrors client `formatCapitalizedWordsText` for the tooltip category. */
4
+ export declare function formatCategoryLabel(text: string): string;
5
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/components/matrix-chart/lib/format.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKvD;AAED,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQxD"}
@@ -0,0 +1,16 @@
1
+ function formatMatrixValue(value) {
2
+ if (!Number.isFinite(value)) return "";
3
+ return new Intl.NumberFormat("en-US", { maximumFractionDigits: 3 }).format(
4
+ value
5
+ );
6
+ }
7
+ function formatCategoryLabel(text) {
8
+ if (!text) return "";
9
+ if (!Number.isNaN(Number(text))) return text;
10
+ return text.replace(/[_-]/g, " ").split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
11
+ }
12
+ export {
13
+ formatCategoryLabel,
14
+ formatMatrixValue
15
+ };
16
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.js","sources":["../../../../src/components/matrix-chart/lib/format.ts"],"sourcesContent":["/** Mirrors client `formatNumber` — grouped, up to 3 decimals. */\nexport function formatMatrixValue(value: number): string {\n if (!Number.isFinite(value)) return '';\n return new Intl.NumberFormat('en-US', { maximumFractionDigits: 3 }).format(\n value,\n );\n}\n\n/** Mirrors client `formatCapitalizedWordsText` for the tooltip category. */\nexport function formatCategoryLabel(text: string): string {\n if (!text) return '';\n if (!Number.isNaN(Number(text))) return text;\n return text\n .replace(/[_-]/g, ' ')\n .split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n}\n"],"names":[],"mappings":"AACO,SAAS,kBAAkB,OAAuB;AACvD,MAAI,CAAC,OAAO,SAAS,KAAK,EAAG,QAAO;AACpC,SAAO,IAAI,KAAK,aAAa,SAAS,EAAE,uBAAuB,EAAA,CAAG,EAAE;AAAA,IAClE;AAAA,EAAA;AAEJ;AAGO,SAAS,oBAAoB,MAAsB;AACxD,MAAI,CAAC,KAAM,QAAO;AAClB,MAAI,CAAC,OAAO,MAAM,OAAO,IAAI,CAAC,EAAG,QAAO;AACxC,SAAO,KACJ,QAAQ,SAAS,GAAG,EACpB,MAAM,GAAG,EACT,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,EAAE,gBAAgB,KAAK,MAAM,CAAC,EAAE,YAAA,CAAa,EACxE,KAAK,GAAG;AACb;"}
@@ -0,0 +1,5 @@
1
+ export { type MatrixCell, type MatrixCellsPayload, type MatrixInput, type MatrixModel, } from './types.js';
2
+ export { normalizeMatrixData } from './normalize.js';
3
+ export { sortAxisDomain } from './domain.js';
4
+ export { formatCategoryLabel, formatMatrixValue } from './format.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/matrix-chart/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { FuseWidgetLike } from '../../../utils/fuse-widget.js';
2
+ import { MatrixInput, MatrixModel } from './types.js';
3
+ /** Normalize chat cells or a FuseDash WidgetItem into a matrix model. */
4
+ export declare function normalizeMatrixData(input: MatrixInput | FuseWidgetLike | null | undefined): MatrixModel;
5
+ //# sourceMappingURL=normalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../src/components/matrix-chart/lib/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAGV,WAAW,EACX,WAAW,EACZ,MAAM,YAAY,CAAC;AAkOpB,yEAAyE;AACzE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,GAAG,cAAc,GAAG,IAAI,GAAG,SAAS,GACrD,WAAW,CAkBb"}
@@ -0,0 +1,165 @@
1
+ import { isFuseWidgetPayload, rowsOf, firstField } from "../../../utils/fuse-widget.js";
2
+ import { sortAxisDomain } from "./domain.js";
3
+ const MAX_FILLED_CELLS = 1e4;
4
+ const EMPTY = {
5
+ cells: [],
6
+ xDomain: [],
7
+ yDomain: [],
8
+ rawValues: [],
9
+ categoryKey: "",
10
+ valueKey: ""
11
+ };
12
+ function isCell(d) {
13
+ if (!d || typeof d !== "object") return false;
14
+ const o = d;
15
+ return "x" in o && "y" in o && "value" in o;
16
+ }
17
+ function toCell(raw) {
18
+ const x = String(raw.x ?? "");
19
+ const y = String(raw.y ?? "");
20
+ const value = Number(raw.value);
21
+ if (!x || !y) return null;
22
+ return { x, y, value: Number.isFinite(value) ? value : 0 };
23
+ }
24
+ function uniqueInOrder(values) {
25
+ const seen = /* @__PURE__ */ new Set();
26
+ const out = [];
27
+ for (const v of values) {
28
+ if (v && !seen.has(v)) {
29
+ seen.add(v);
30
+ out.push(v);
31
+ }
32
+ }
33
+ return out;
34
+ }
35
+ function modelFromCells(cells, xDomain, yDomain) {
36
+ const cleaned = cells.map(toCell).filter((c) => c != null);
37
+ return {
38
+ cells: cleaned,
39
+ xDomain: (xDomain == null ? void 0 : xDomain.length) ? xDomain : uniqueInOrder(cleaned.map((c) => c.x)),
40
+ yDomain: (yDomain == null ? void 0 : yDomain.length) ? yDomain : uniqueInOrder(cleaned.map((c) => c.y)),
41
+ rawValues: cleaned.map((c) => c.value),
42
+ categoryKey: "",
43
+ valueKey: ""
44
+ };
45
+ }
46
+ function additionalKeysOf(rows, xKey, valueKey) {
47
+ const reserved = /* @__PURE__ */ new Set([xKey, valueKey]);
48
+ const keys = /* @__PURE__ */ new Set();
49
+ for (const row of rows) {
50
+ for (const key of Object.keys(row)) {
51
+ if (!reserved.has(key)) keys.add(key);
52
+ }
53
+ }
54
+ return [...keys];
55
+ }
56
+ function joinValue(value) {
57
+ if (typeof value === "number") return value;
58
+ return String(value).replace(/\s+/g, "");
59
+ }
60
+ function normalizeLocationValue(value) {
61
+ if (value == null) return "";
62
+ if (typeof value === "number") return value;
63
+ if (typeof value !== "string") return String(value);
64
+ const trimmed = value.trim();
65
+ if (trimmed === "") return "";
66
+ const numValue = Number(trimmed);
67
+ if (Number.isFinite(numValue)) return numValue;
68
+ const commaIndex = trimmed.indexOf(", ");
69
+ if (commaIndex !== -1) return trimmed.substring(commaIndex + 2).trim();
70
+ return trimmed;
71
+ }
72
+ function fillWithZeroData(widget, rows, xKey, valueKey, fillKey) {
73
+ const uniqueValues = widget.uniqueValues ?? {};
74
+ const passthrough = () => rows.map((row) => ({
75
+ ...row,
76
+ ...fillKey ? { [fillKey]: normalizeLocationValue(row[fillKey]) } : {}
77
+ }));
78
+ const xValues = uniqueValues[xKey] ?? [];
79
+ const yValues = fillKey ? uniqueValues[fillKey] ?? [] : [];
80
+ const total = xValues.length * yValues.length;
81
+ if (!total || total === rows.length || total > MAX_FILLED_CELLS) {
82
+ return passthrough();
83
+ }
84
+ const byKey = /* @__PURE__ */ new Map();
85
+ for (const row of rows) {
86
+ byKey.set(`${joinValue(row[xKey])}-${joinValue(row[fillKey])}`, row);
87
+ }
88
+ const filled = [];
89
+ for (const xValue of xValues) {
90
+ for (const yValue of yValues) {
91
+ const matched = byKey.get(`${joinValue(xValue)}-${joinValue(yValue)}`);
92
+ filled.push(
93
+ matched ?? { [xKey]: xValue, [fillKey]: yValue, [valueKey]: 0 }
94
+ );
95
+ }
96
+ }
97
+ return filled;
98
+ }
99
+ function resolveCategoryKey(widget, additionalKeys) {
100
+ const uniqueValues = widget.uniqueValues ?? {};
101
+ const groupField = firstField(widget.groupBy);
102
+ if (groupField && additionalKeys.includes(groupField)) return groupField;
103
+ return additionalKeys.find((key) => uniqueValues[key]) ?? additionalKeys[0] ?? "y";
104
+ }
105
+ function fromFuseWidget(widget) {
106
+ const rows = rowsOf(widget);
107
+ if (!rows.length) return EMPTY;
108
+ const xKey = firstField(widget.xAxe) ?? "x";
109
+ const valueKey = firstField(widget.yAxe) ?? "y";
110
+ const rawValues = rows.map((row) => {
111
+ const value = Number(row.value ?? row[valueKey]);
112
+ return Number.isFinite(value) ? value : 0;
113
+ });
114
+ const additionalKeys = additionalKeysOf(rows, xKey, valueKey);
115
+ const categoryKey = resolveCategoryKey(widget, additionalKeys);
116
+ const uniqueValues = widget.uniqueValues ?? {};
117
+ const yValuesRaw = Array.isArray(uniqueValues[categoryKey]) ? uniqueValues[categoryKey] : rows.map((row) => row[categoryKey]);
118
+ const yDomain = sortAxisDomain(
119
+ [...new Set(yValuesRaw)].filter(Boolean)
120
+ ).map(String);
121
+ const xDomain = sortAxisDomain(
122
+ [...new Set(rows.map((row) => row[xKey]))].filter(Boolean)
123
+ ).map(String);
124
+ const filled = fillWithZeroData(widget, rows, xKey, valueKey, categoryKey);
125
+ const cells = [];
126
+ for (const row of filled) {
127
+ const x = row[xKey];
128
+ const y = row[categoryKey];
129
+ if (x == null || y == null) continue;
130
+ const value = Number(row.value ?? row[valueKey] ?? 0);
131
+ cells.push({
132
+ x: String(x),
133
+ y: String(y),
134
+ value: Number.isFinite(value) ? value : 0
135
+ });
136
+ }
137
+ return {
138
+ cells,
139
+ xDomain,
140
+ yDomain,
141
+ rawValues,
142
+ categoryKey,
143
+ valueKey,
144
+ axisDetails: widget.axisDetails ?? void 0
145
+ };
146
+ }
147
+ function normalizeMatrixData(input) {
148
+ if (!input) return EMPTY;
149
+ if (Array.isArray(input)) {
150
+ if (!input.length || !isCell(input[0])) return EMPTY;
151
+ return modelFromCells(input);
152
+ }
153
+ const payload = input;
154
+ if (Array.isArray(payload.cells)) {
155
+ return modelFromCells(payload.cells, payload.xDomain, payload.yDomain);
156
+ }
157
+ if (isFuseWidgetPayload(input)) {
158
+ return fromFuseWidget(input);
159
+ }
160
+ return EMPTY;
161
+ }
162
+ export {
163
+ normalizeMatrixData
164
+ };
165
+ //# sourceMappingURL=normalize.js.map