@adminiumjs/charts 0.1.0-rc.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 (327) hide show
  1. package/LICENSE +661 -0
  2. package/dist/components/AnomalyChart.d.ts +30 -0
  3. package/dist/components/AnomalyChart.d.ts.map +1 -0
  4. package/dist/components/AnomalyChart.js +32 -0
  5. package/dist/components/AnomalyChart.js.map +1 -0
  6. package/dist/components/BarChart.d.ts +33 -0
  7. package/dist/components/BarChart.d.ts.map +1 -0
  8. package/dist/components/BarChart.js +40 -0
  9. package/dist/components/BarChart.js.map +1 -0
  10. package/dist/components/BoxPlotChart.d.ts +23 -0
  11. package/dist/components/BoxPlotChart.d.ts.map +1 -0
  12. package/dist/components/BoxPlotChart.js +24 -0
  13. package/dist/components/BoxPlotChart.js.map +1 -0
  14. package/dist/components/BulletChart.d.ts +27 -0
  15. package/dist/components/BulletChart.d.ts.map +1 -0
  16. package/dist/components/BulletChart.js +24 -0
  17. package/dist/components/BulletChart.js.map +1 -0
  18. package/dist/components/BumpChart.d.ts +27 -0
  19. package/dist/components/BumpChart.d.ts.map +1 -0
  20. package/dist/components/BumpChart.js +17 -0
  21. package/dist/components/BumpChart.js.map +1 -0
  22. package/dist/components/CandlestickChart.d.ts +26 -0
  23. package/dist/components/CandlestickChart.d.ts.map +1 -0
  24. package/dist/components/CandlestickChart.js +22 -0
  25. package/dist/components/CandlestickChart.js.map +1 -0
  26. package/dist/components/ChartSurface.d.ts +52 -0
  27. package/dist/components/ChartSurface.d.ts.map +1 -0
  28. package/dist/components/ChartSurface.js +15 -0
  29. package/dist/components/ChartSurface.js.map +1 -0
  30. package/dist/components/Chord.d.ts +30 -0
  31. package/dist/components/Chord.d.ts.map +1 -0
  32. package/dist/components/Chord.js +14 -0
  33. package/dist/components/Chord.js.map +1 -0
  34. package/dist/components/ChoroplethGridChart.d.ts +32 -0
  35. package/dist/components/ChoroplethGridChart.d.ts.map +1 -0
  36. package/dist/components/ChoroplethGridChart.js +15 -0
  37. package/dist/components/ChoroplethGridChart.js.map +1 -0
  38. package/dist/components/CohortMatrixChart.d.ts +30 -0
  39. package/dist/components/CohortMatrixChart.d.ts.map +1 -0
  40. package/dist/components/CohortMatrixChart.js +13 -0
  41. package/dist/components/CohortMatrixChart.js.map +1 -0
  42. package/dist/components/CorrelationMatrixChart.d.ts +24 -0
  43. package/dist/components/CorrelationMatrixChart.d.ts.map +1 -0
  44. package/dist/components/CorrelationMatrixChart.js +29 -0
  45. package/dist/components/CorrelationMatrixChart.js.map +1 -0
  46. package/dist/components/DonutChart.d.ts +31 -0
  47. package/dist/components/DonutChart.d.ts.map +1 -0
  48. package/dist/components/DonutChart.js +19 -0
  49. package/dist/components/DonutChart.js.map +1 -0
  50. package/dist/components/ForecastChart.d.ts +37 -0
  51. package/dist/components/ForecastChart.d.ts.map +1 -0
  52. package/dist/components/ForecastChart.js +39 -0
  53. package/dist/components/ForecastChart.js.map +1 -0
  54. package/dist/components/Funnel.d.ts +27 -0
  55. package/dist/components/Funnel.d.ts.map +1 -0
  56. package/dist/components/Funnel.js +25 -0
  57. package/dist/components/Funnel.js.map +1 -0
  58. package/dist/components/HeatCalendarChart.d.ts +39 -0
  59. package/dist/components/HeatCalendarChart.d.ts.map +1 -0
  60. package/dist/components/HeatCalendarChart.js +37 -0
  61. package/dist/components/HeatCalendarChart.js.map +1 -0
  62. package/dist/components/HeatMonthChart.d.ts +30 -0
  63. package/dist/components/HeatMonthChart.d.ts.map +1 -0
  64. package/dist/components/HeatMonthChart.js +14 -0
  65. package/dist/components/HeatMonthChart.js.map +1 -0
  66. package/dist/components/HexbinChart.d.ts +22 -0
  67. package/dist/components/HexbinChart.d.ts.map +1 -0
  68. package/dist/components/HexbinChart.js +31 -0
  69. package/dist/components/HexbinChart.js.map +1 -0
  70. package/dist/components/LineAreaChart.d.ts +26 -0
  71. package/dist/components/LineAreaChart.d.ts.map +1 -0
  72. package/dist/components/LineAreaChart.js +62 -0
  73. package/dist/components/LineAreaChart.js.map +1 -0
  74. package/dist/components/MarimekkoChart.d.ts +24 -0
  75. package/dist/components/MarimekkoChart.d.ts.map +1 -0
  76. package/dist/components/MarimekkoChart.js +20 -0
  77. package/dist/components/MarimekkoChart.js.map +1 -0
  78. package/dist/components/MultiLineChart.d.ts +36 -0
  79. package/dist/components/MultiLineChart.d.ts.map +1 -0
  80. package/dist/components/MultiLineChart.js +62 -0
  81. package/dist/components/MultiLineChart.js.map +1 -0
  82. package/dist/components/ParallelCoordinatesChart.d.ts +22 -0
  83. package/dist/components/ParallelCoordinatesChart.d.ts.map +1 -0
  84. package/dist/components/ParallelCoordinatesChart.js +16 -0
  85. package/dist/components/ParallelCoordinatesChart.js.map +1 -0
  86. package/dist/components/ParetoChart.d.ts +26 -0
  87. package/dist/components/ParetoChart.d.ts.map +1 -0
  88. package/dist/components/ParetoChart.js +26 -0
  89. package/dist/components/ParetoChart.js.map +1 -0
  90. package/dist/components/Radar.d.ts +27 -0
  91. package/dist/components/Radar.d.ts.map +1 -0
  92. package/dist/components/Radar.js +19 -0
  93. package/dist/components/Radar.js.map +1 -0
  94. package/dist/components/RadialBar.d.ts +25 -0
  95. package/dist/components/RadialBar.d.ts.map +1 -0
  96. package/dist/components/RadialBar.js +12 -0
  97. package/dist/components/RadialBar.js.map +1 -0
  98. package/dist/components/RankingBars.d.ts +27 -0
  99. package/dist/components/RankingBars.d.ts.map +1 -0
  100. package/dist/components/RankingBars.js +25 -0
  101. package/dist/components/RankingBars.js.map +1 -0
  102. package/dist/components/RidgelineChart.d.ts +23 -0
  103. package/dist/components/RidgelineChart.d.ts.map +1 -0
  104. package/dist/components/RidgelineChart.js +20 -0
  105. package/dist/components/RidgelineChart.js.map +1 -0
  106. package/dist/components/SankeyChart.d.ts +29 -0
  107. package/dist/components/SankeyChart.d.ts.map +1 -0
  108. package/dist/components/SankeyChart.js +21 -0
  109. package/dist/components/SankeyChart.js.map +1 -0
  110. package/dist/components/ScatterBubbleChart.d.ts +26 -0
  111. package/dist/components/ScatterBubbleChart.d.ts.map +1 -0
  112. package/dist/components/ScatterBubbleChart.js +31 -0
  113. package/dist/components/ScatterBubbleChart.js.map +1 -0
  114. package/dist/components/SlopeChart.d.ts +28 -0
  115. package/dist/components/SlopeChart.d.ts.map +1 -0
  116. package/dist/components/SlopeChart.js +18 -0
  117. package/dist/components/SlopeChart.js.map +1 -0
  118. package/dist/components/Sparkline.d.ts +15 -0
  119. package/dist/components/Sparkline.d.ts.map +1 -0
  120. package/dist/components/Sparkline.js +27 -0
  121. package/dist/components/Sparkline.js.map +1 -0
  122. package/dist/components/StackedBar100.d.ts +30 -0
  123. package/dist/components/StackedBar100.d.ts.map +1 -0
  124. package/dist/components/StackedBar100.js +21 -0
  125. package/dist/components/StackedBar100.js.map +1 -0
  126. package/dist/components/StreamChart.d.ts +23 -0
  127. package/dist/components/StreamChart.d.ts.map +1 -0
  128. package/dist/components/StreamChart.js +56 -0
  129. package/dist/components/StreamChart.js.map +1 -0
  130. package/dist/components/Sunburst.d.ts +24 -0
  131. package/dist/components/Sunburst.d.ts.map +1 -0
  132. package/dist/components/Sunburst.js +13 -0
  133. package/dist/components/Sunburst.js.map +1 -0
  134. package/dist/components/TimelineLanesChart.d.ts +25 -0
  135. package/dist/components/TimelineLanesChart.d.ts.map +1 -0
  136. package/dist/components/TimelineLanesChart.js +41 -0
  137. package/dist/components/TimelineLanesChart.js.map +1 -0
  138. package/dist/components/Treemap.d.ts +28 -0
  139. package/dist/components/Treemap.d.ts.map +1 -0
  140. package/dist/components/Treemap.js +22 -0
  141. package/dist/components/Treemap.js.map +1 -0
  142. package/dist/components/ViolinChart.d.ts +22 -0
  143. package/dist/components/ViolinChart.d.ts.map +1 -0
  144. package/dist/components/ViolinChart.js +21 -0
  145. package/dist/components/ViolinChart.js.map +1 -0
  146. package/dist/components/WaterfallChart.d.ts +23 -0
  147. package/dist/components/WaterfallChart.d.ts.map +1 -0
  148. package/dist/components/WaterfallChart.js +29 -0
  149. package/dist/components/WaterfallChart.js.map +1 -0
  150. package/dist/components/WordCloud.d.ts +24 -0
  151. package/dist/components/WordCloud.d.ts.map +1 -0
  152. package/dist/components/WordCloud.js +22 -0
  153. package/dist/components/WordCloud.js.map +1 -0
  154. package/dist/demo/barsRanking.d.ts +26 -0
  155. package/dist/demo/barsRanking.d.ts.map +1 -0
  156. package/dist/demo/barsRanking.js +80 -0
  157. package/dist/demo/barsRanking.js.map +1 -0
  158. package/dist/demo/generators.d.ts +44 -0
  159. package/dist/demo/generators.d.ts.map +1 -0
  160. package/dist/demo/generators.js +72 -0
  161. package/dist/demo/generators.js.map +1 -0
  162. package/dist/demo/mulberry32.d.ts +10 -0
  163. package/dist/demo/mulberry32.d.ts.map +1 -0
  164. package/dist/demo/mulberry32.js +26 -0
  165. package/dist/demo/mulberry32.js.map +1 -0
  166. package/dist/geometry/anomaly.d.ts +22 -0
  167. package/dist/geometry/anomaly.d.ts.map +1 -0
  168. package/dist/geometry/anomaly.js +52 -0
  169. package/dist/geometry/anomaly.js.map +1 -0
  170. package/dist/geometry/bars.d.ts +46 -0
  171. package/dist/geometry/bars.d.ts.map +1 -0
  172. package/dist/geometry/bars.js +68 -0
  173. package/dist/geometry/bars.js.map +1 -0
  174. package/dist/geometry/bullet.d.ts +53 -0
  175. package/dist/geometry/bullet.d.ts.map +1 -0
  176. package/dist/geometry/bullet.js +67 -0
  177. package/dist/geometry/bullet.js.map +1 -0
  178. package/dist/geometry/bump.d.ts +42 -0
  179. package/dist/geometry/bump.d.ts.map +1 -0
  180. package/dist/geometry/bump.js +29 -0
  181. package/dist/geometry/bump.js.map +1 -0
  182. package/dist/geometry/candles.d.ts +39 -0
  183. package/dist/geometry/candles.d.ts.map +1 -0
  184. package/dist/geometry/candles.js +42 -0
  185. package/dist/geometry/candles.js.map +1 -0
  186. package/dist/geometry/chord.d.ts +53 -0
  187. package/dist/geometry/chord.d.ts.map +1 -0
  188. package/dist/geometry/chord.js +111 -0
  189. package/dist/geometry/chord.js.map +1 -0
  190. package/dist/geometry/choropleth.d.ts +58 -0
  191. package/dist/geometry/choropleth.d.ts.map +1 -0
  192. package/dist/geometry/choropleth.js +101 -0
  193. package/dist/geometry/choropleth.js.map +1 -0
  194. package/dist/geometry/cohort.d.ts +54 -0
  195. package/dist/geometry/cohort.d.ts.map +1 -0
  196. package/dist/geometry/cohort.js +70 -0
  197. package/dist/geometry/cohort.js.map +1 -0
  198. package/dist/geometry/correlation.d.ts +138 -0
  199. package/dist/geometry/correlation.d.ts.map +1 -0
  200. package/dist/geometry/correlation.js +161 -0
  201. package/dist/geometry/correlation.js.map +1 -0
  202. package/dist/geometry/distribution.d.ts +115 -0
  203. package/dist/geometry/distribution.d.ts.map +1 -0
  204. package/dist/geometry/distribution.js +131 -0
  205. package/dist/geometry/distribution.js.map +1 -0
  206. package/dist/geometry/donut.d.ts +37 -0
  207. package/dist/geometry/donut.d.ts.map +1 -0
  208. package/dist/geometry/donut.js +46 -0
  209. package/dist/geometry/donut.js.map +1 -0
  210. package/dist/geometry/forecast.d.ts +30 -0
  211. package/dist/geometry/forecast.d.ts.map +1 -0
  212. package/dist/geometry/forecast.js +75 -0
  213. package/dist/geometry/forecast.js.map +1 -0
  214. package/dist/geometry/funnel.d.ts +37 -0
  215. package/dist/geometry/funnel.d.ts.map +1 -0
  216. package/dist/geometry/funnel.js +42 -0
  217. package/dist/geometry/funnel.js.map +1 -0
  218. package/dist/geometry/heat.d.ts +34 -0
  219. package/dist/geometry/heat.d.ts.map +1 -0
  220. package/dist/geometry/heat.js +50 -0
  221. package/dist/geometry/heat.js.map +1 -0
  222. package/dist/geometry/heatCalendar.d.ts +43 -0
  223. package/dist/geometry/heatCalendar.d.ts.map +1 -0
  224. package/dist/geometry/heatCalendar.js +82 -0
  225. package/dist/geometry/heatCalendar.js.map +1 -0
  226. package/dist/geometry/heatMonth.d.ts +47 -0
  227. package/dist/geometry/heatMonth.d.ts.map +1 -0
  228. package/dist/geometry/heatMonth.js +72 -0
  229. package/dist/geometry/heatMonth.js.map +1 -0
  230. package/dist/geometry/lineArea.d.ts +17 -0
  231. package/dist/geometry/lineArea.d.ts.map +1 -0
  232. package/dist/geometry/lineArea.js +37 -0
  233. package/dist/geometry/lineArea.js.map +1 -0
  234. package/dist/geometry/marimekko.d.ts +43 -0
  235. package/dist/geometry/marimekko.d.ts.map +1 -0
  236. package/dist/geometry/marimekko.js +45 -0
  237. package/dist/geometry/marimekko.js.map +1 -0
  238. package/dist/geometry/multiLine.d.ts +19 -0
  239. package/dist/geometry/multiLine.d.ts.map +1 -0
  240. package/dist/geometry/multiLine.js +25 -0
  241. package/dist/geometry/multiLine.js.map +1 -0
  242. package/dist/geometry/pareto.d.ts +44 -0
  243. package/dist/geometry/pareto.d.ts.map +1 -0
  244. package/dist/geometry/pareto.js +65 -0
  245. package/dist/geometry/pareto.js.map +1 -0
  246. package/dist/geometry/radar.d.ts +60 -0
  247. package/dist/geometry/radar.d.ts.map +1 -0
  248. package/dist/geometry/radar.js +67 -0
  249. package/dist/geometry/radar.js.map +1 -0
  250. package/dist/geometry/radialBar.d.ts +31 -0
  251. package/dist/geometry/radialBar.d.ts.map +1 -0
  252. package/dist/geometry/radialBar.js +53 -0
  253. package/dist/geometry/radialBar.js.map +1 -0
  254. package/dist/geometry/ranking.d.ts +48 -0
  255. package/dist/geometry/ranking.d.ts.map +1 -0
  256. package/dist/geometry/ranking.js +42 -0
  257. package/dist/geometry/ranking.js.map +1 -0
  258. package/dist/geometry/sankey.d.ts +60 -0
  259. package/dist/geometry/sankey.d.ts.map +1 -0
  260. package/dist/geometry/sankey.js +130 -0
  261. package/dist/geometry/sankey.js.map +1 -0
  262. package/dist/geometry/scales.d.ts +14 -0
  263. package/dist/geometry/scales.d.ts.map +1 -0
  264. package/dist/geometry/scales.js +33 -0
  265. package/dist/geometry/scales.js.map +1 -0
  266. package/dist/geometry/slope.d.ts +34 -0
  267. package/dist/geometry/slope.d.ts.map +1 -0
  268. package/dist/geometry/slope.js +44 -0
  269. package/dist/geometry/slope.js.map +1 -0
  270. package/dist/geometry/sparkline.d.ts +20 -0
  271. package/dist/geometry/sparkline.d.ts.map +1 -0
  272. package/dist/geometry/sparkline.js +43 -0
  273. package/dist/geometry/sparkline.js.map +1 -0
  274. package/dist/geometry/stacked100.d.ts +33 -0
  275. package/dist/geometry/stacked100.d.ts.map +1 -0
  276. package/dist/geometry/stacked100.js +34 -0
  277. package/dist/geometry/stacked100.js.map +1 -0
  278. package/dist/geometry/streamStack.d.ts +32 -0
  279. package/dist/geometry/streamStack.d.ts.map +1 -0
  280. package/dist/geometry/streamStack.js +56 -0
  281. package/dist/geometry/streamStack.js.map +1 -0
  282. package/dist/geometry/sunburst.d.ts +37 -0
  283. package/dist/geometry/sunburst.d.ts.map +1 -0
  284. package/dist/geometry/sunburst.js +84 -0
  285. package/dist/geometry/sunburst.js.map +1 -0
  286. package/dist/geometry/timelineLanes.d.ts +46 -0
  287. package/dist/geometry/timelineLanes.d.ts.map +1 -0
  288. package/dist/geometry/timelineLanes.js +52 -0
  289. package/dist/geometry/timelineLanes.js.map +1 -0
  290. package/dist/geometry/treemap.d.ts +42 -0
  291. package/dist/geometry/treemap.d.ts.map +1 -0
  292. package/dist/geometry/treemap.js +134 -0
  293. package/dist/geometry/treemap.js.map +1 -0
  294. package/dist/geometry/waterfall.d.ts +40 -0
  295. package/dist/geometry/waterfall.d.ts.map +1 -0
  296. package/dist/geometry/waterfall.js +80 -0
  297. package/dist/geometry/waterfall.js.map +1 -0
  298. package/dist/geometry/wordcloud.d.ts +46 -0
  299. package/dist/geometry/wordcloud.d.ts.map +1 -0
  300. package/dist/geometry/wordcloud.js +79 -0
  301. package/dist/geometry/wordcloud.js.map +1 -0
  302. package/dist/hooks/useChartSize.d.ts +6 -0
  303. package/dist/hooks/useChartSize.d.ts.map +1 -0
  304. package/dist/hooks/useChartSize.js +32 -0
  305. package/dist/hooks/useChartSize.js.map +1 -0
  306. package/dist/hooks/useMountAnimation.d.ts +4 -0
  307. package/dist/hooks/useMountAnimation.d.ts.map +1 -0
  308. package/dist/hooks/useMountAnimation.js +40 -0
  309. package/dist/hooks/useMountAnimation.js.map +1 -0
  310. package/dist/hooks/useRtl.d.ts +7 -0
  311. package/dist/hooks/useRtl.d.ts.map +1 -0
  312. package/dist/hooks/useRtl.js +18 -0
  313. package/dist/hooks/useRtl.js.map +1 -0
  314. package/dist/index.d.ts +110 -0
  315. package/dist/index.d.ts.map +1 -0
  316. package/dist/index.js +79 -0
  317. package/dist/index.js.map +1 -0
  318. package/dist/utils/format.d.ts +5 -0
  319. package/dist/utils/format.d.ts.map +1 -0
  320. package/dist/utils/format.js +24 -0
  321. package/dist/utils/format.js.map +1 -0
  322. package/dist/utils/stats.d.ts +23 -0
  323. package/dist/utils/stats.d.ts.map +1 -0
  324. package/dist/utils/stats.js +82 -0
  325. package/dist/utils/stats.js.map +1 -0
  326. package/package.json +36 -0
  327. package/src/styles.css +205 -0
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Pure word-cloud geometry (`chart-wordcloud`, research/widget-registry.md §2):
3
+ * terms sized by frequency and flowed into wrapped rows within a fixed width.
4
+ * Widths are estimated from character count (no DOM text metrics) so the layout
5
+ * is byte-identical in a report worker and the browser (04 §7.1). Terms flow
6
+ * start→end; RTL mirrors each row's x per §7.4.
7
+ */
8
+ export interface WordInput {
9
+ term: string;
10
+ weight: number;
11
+ }
12
+ export interface WordToken {
13
+ term: string;
14
+ weight: number;
15
+ /** Resolved font size in px. */
16
+ fontSize: number;
17
+ x: number;
18
+ y: number;
19
+ /** Baseline-independent block width used for wrapping. */
20
+ width: number;
21
+ colorVar: string;
22
+ }
23
+ export interface WordCloudLayout {
24
+ tokens: WordToken[];
25
+ width: number;
26
+ height: number;
27
+ }
28
+ export interface WordCloudOptions {
29
+ width: number;
30
+ /** Max terms rendered; the rest are dropped (default all). */
31
+ maxTerms?: number;
32
+ minFontSize?: number;
33
+ maxFontSize?: number;
34
+ /** Horizontal gap between terms, px (default 14). */
35
+ gapX?: number;
36
+ /** Extra line height above the font size, px (default 10). */
37
+ lineGap?: number;
38
+ rtl?: boolean;
39
+ }
40
+ /**
41
+ * Flow tokens into rows. Font size scales linearly with weight across the
42
+ * observed [min,max]; a single distinct weight maps to the max size. Returns
43
+ * empty tokens for a non-positive width or no terms.
44
+ */
45
+ export declare function wordCloudLayout(input: readonly WordInput[], options: WordCloudOptions): WordCloudLayout;
46
+ //# sourceMappingURL=wordcloud.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordcloud.d.ts","sourceRoot":"","sources":["../../src/geometry/wordcloud.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAWD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAmEvG"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Pure word-cloud geometry (`chart-wordcloud`, research/widget-registry.md §2):
3
+ * terms sized by frequency and flowed into wrapped rows within a fixed width.
4
+ * Widths are estimated from character count (no DOM text metrics) so the layout
5
+ * is byte-identical in a report worker and the browser (04 §7.1). Terms flow
6
+ * start→end; RTL mirrors each row's x per §7.4.
7
+ */
8
+ function vizColor(index) {
9
+ return `var(--viz-${(index % 8) + 1})`;
10
+ }
11
+ /** Deterministic width estimate: average glyph advance ≈ 0.58em + padding. */
12
+ function estimateWidth(term, fontSize) {
13
+ return term.length * fontSize * 0.58 + fontSize * 0.5;
14
+ }
15
+ /**
16
+ * Flow tokens into rows. Font size scales linearly with weight across the
17
+ * observed [min,max]; a single distinct weight maps to the max size. Returns
18
+ * empty tokens for a non-positive width or no terms.
19
+ */
20
+ export function wordCloudLayout(input, options) {
21
+ const { width, maxTerms = Infinity, minFontSize = 13, maxFontSize = 40, gapX = 14, lineGap = 10, rtl = false, } = options;
22
+ const terms = input
23
+ .filter((w) => Number.isFinite(w.weight) && w.weight > 0)
24
+ .slice(0, Number.isFinite(maxTerms) ? maxTerms : undefined);
25
+ if (width <= 0 || terms.length === 0)
26
+ return { tokens: [], width: Math.max(0, width), height: 0 };
27
+ const weights = terms.map((t) => t.weight);
28
+ const lo = Math.min(...weights);
29
+ const hi = Math.max(...weights);
30
+ const fontFor = (weight) => {
31
+ if (hi === lo)
32
+ return maxFontSize;
33
+ return Math.round(minFontSize + ((weight - lo) / (hi - lo)) * (maxFontSize - minFontSize));
34
+ };
35
+ // First pass: assign sizes + widths, flow into rows (start-aligned).
36
+ const rows = [];
37
+ let row = [];
38
+ let cursorX = 0;
39
+ let rowMaxFont = 0;
40
+ let y = 0;
41
+ const commitRow = () => {
42
+ if (row.length === 0)
43
+ return;
44
+ const lineHeight = rowMaxFont + lineGap;
45
+ for (const token of row)
46
+ token.y = y + lineHeight / 2;
47
+ rows.push(row);
48
+ y += lineHeight;
49
+ row = [];
50
+ cursorX = 0;
51
+ rowMaxFont = 0;
52
+ };
53
+ terms.forEach((term, index) => {
54
+ const fontSize = fontFor(term.weight);
55
+ const w = estimateWidth(term.term, fontSize);
56
+ if (row.length > 0 && cursorX + gapX + w > width)
57
+ commitRow();
58
+ const token = {
59
+ term: term.term,
60
+ weight: term.weight,
61
+ fontSize,
62
+ x: cursorX,
63
+ y: 0,
64
+ width: w,
65
+ colorVar: vizColor(index),
66
+ };
67
+ row.push(token);
68
+ cursorX += w + gapX;
69
+ rowMaxFont = Math.max(rowMaxFont, fontSize);
70
+ });
71
+ commitRow();
72
+ const tokens = rows.flat();
73
+ if (rtl) {
74
+ for (const token of tokens)
75
+ token.x = width - token.x - token.width;
76
+ }
77
+ return { tokens, width, height: y };
78
+ }
79
+ //# sourceMappingURL=wordcloud.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wordcloud.js","sourceRoot":"","sources":["../../src/geometry/wordcloud.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsCH,SAAS,QAAQ,CAAC,KAAa;IAC7B,OAAO,aAAa,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;AACzC,CAAC;AAED,8EAA8E;AAC9E,SAAS,aAAa,CAAC,IAAY,EAAE,QAAgB;IACnD,OAAO,IAAI,CAAC,MAAM,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,GAAG,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B,EAAE,OAAyB;IACpF,MAAM,EACJ,KAAK,EACL,QAAQ,GAAG,QAAQ,EACnB,WAAW,GAAG,EAAE,EAChB,WAAW,GAAG,EAAE,EAChB,IAAI,GAAG,EAAE,EACT,OAAO,GAAG,EAAE,EACZ,GAAG,GAAG,KAAK,GACZ,GAAG,OAAO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C;IAEZ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,GAAG,EAAE,CAAC;QACR,KAAK,MAAM,KAAK,IAAI,MAAM;YAAE,KAAK,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;IACtE,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { RefObject } from 'react';
2
+ export declare function useMeasuredWidth<T extends HTMLElement>(initialWidth?: number): {
3
+ ref: RefObject<T | null>;
4
+ width: number;
5
+ };
6
+ //# sourceMappingURL=useChartSize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChartSize.d.ts","sourceRoot":"","sources":["../../src/hooks/useChartSize.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,WAAW,EACpD,YAAY,SAAM,GACjB;IAAE,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAwB7C"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Responsive width via ResizeObserver. Charts are fluid in the inline axis
3
+ * (grid cells set the block size); the SVG viewBox tracks the measured width
4
+ * so geometry renders 1:1 with CSS pixels.
5
+ *
6
+ * Environments without ResizeObserver (SSR, happy-dom) keep `initialWidth`.
7
+ */
8
+ import { useEffect, useRef, useState } from 'react';
9
+ export function useMeasuredWidth(initialWidth = 600) {
10
+ const ref = useRef(null);
11
+ const [width, setWidth] = useState(initialWidth);
12
+ useEffect(() => {
13
+ const element = ref.current;
14
+ if (element === null || typeof ResizeObserver === 'undefined')
15
+ return undefined;
16
+ const measure = (next) => {
17
+ if (next > 0)
18
+ setWidth((prev) => (Math.abs(prev - next) < 0.5 ? prev : next));
19
+ };
20
+ measure(element.getBoundingClientRect().width);
21
+ const observer = new ResizeObserver((entries) => {
22
+ for (const entry of entries) {
23
+ const inline = entry.contentBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;
24
+ measure(inline);
25
+ }
26
+ });
27
+ observer.observe(element);
28
+ return () => observer.disconnect();
29
+ }, []);
30
+ return { ref, width };
31
+ }
32
+ //# sourceMappingURL=useChartSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChartSize.js","sourceRoot":"","sources":["../../src/hooks/useChartSize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGpD,MAAM,UAAU,gBAAgB,CAC9B,YAAY,GAAG,GAAG;IAElB,MAAM,GAAG,GAAG,MAAM,CAAW,IAAI,CAAC,CAAC;IACnC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC5B,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,cAAc,KAAK,WAAW;YAAE,OAAO,SAAS,CAAC;QAEhF,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE;YAC/B,IAAI,IAAI,GAAG,CAAC;gBAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAChF,CAAC,CAAC;QACF,OAAO,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,CAAC;QAE/C,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC9C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;gBAC5B,MAAM,MAAM,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC;gBAChF,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC;QACH,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1B,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AACxB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare function prefersReducedMotion(): boolean;
2
+ /** True once entrance transitions should be in their final state. */
3
+ export declare function useMountAnimation(): boolean;
4
+ //# sourceMappingURL=useMountAnimation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMountAnimation.d.ts","sourceRoot":"","sources":["../../src/hooks/useMountAnimation.ts"],"names":[],"mappings":"AAYA,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,IAAI,OAAO,CAqB3C"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Mount-animation gate (workplan/04-widget-registry.md §7.5 and
3
+ * research/design-system.md §4.3): elements render in their "from" state,
4
+ * then flip to the final state after a double requestAnimationFrame so the
5
+ * browser commits the initial frame and CSS transitions run.
6
+ *
7
+ * `prefers-reduced-motion` renders the final state immediately (mandatory —
8
+ * the comps lack this; tokens' motion.css additionally zeroes transition
9
+ * durations globally under reduced motion).
10
+ */
11
+ import { useEffect, useState } from 'react';
12
+ export function prefersReducedMotion() {
13
+ if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')
14
+ return false;
15
+ return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
16
+ }
17
+ /** True once entrance transitions should be in their final state. */
18
+ export function useMountAnimation() {
19
+ const [mounted, setMounted] = useState(() => prefersReducedMotion());
20
+ useEffect(() => {
21
+ if (mounted)
22
+ return undefined;
23
+ if (typeof requestAnimationFrame !== 'function') {
24
+ setMounted(true);
25
+ return undefined;
26
+ }
27
+ let second = 0;
28
+ const first = requestAnimationFrame(() => {
29
+ second = requestAnimationFrame(() => setMounted(true));
30
+ });
31
+ return () => {
32
+ cancelAnimationFrame(first);
33
+ if (second !== 0)
34
+ cancelAnimationFrame(second);
35
+ };
36
+ // Intentionally mount-only: `mounted` can only flip false→true.
37
+ }, []);
38
+ return mounted;
39
+ }
40
+ //# sourceMappingURL=useMountAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMountAnimation.js","sourceRoot":"","sources":["../../src/hooks/useMountAnimation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,UAAU,oBAAoB;IAClC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IAC3F,OAAO,MAAM,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC,OAAO,CAAC;AACvE,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,iBAAiB;IAC/B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAErE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO;YAAE,OAAO,SAAS,CAAC;QAC9B,IAAI,OAAO,qBAAqB,KAAK,UAAU,EAAE,CAAC;YAChD,UAAU,CAAC,IAAI,CAAC,CAAC;YACjB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,MAAM,KAAK,GAAG,qBAAqB,CAAC,GAAG,EAAE;YACvC,MAAM,GAAG,qBAAqB,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACV,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAC5B,IAAI,MAAM,KAAK,CAAC;gBAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACjD,CAAC,CAAC;QACF,gEAAgE;IAClE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export type ChartDir = 'ltr' | 'rtl';
2
+ export declare const ChartDirectionContext: import("react").Context<ChartDir>;
3
+ /** Resolved direction: explicit prop wins, then the nearest provider ('ltr' default). */
4
+ export declare function useChartDir(override?: ChartDir): ChartDir;
5
+ /** Convenience boolean used by geometry callers. */
6
+ export declare function useRtl(override?: ChartDir): boolean;
7
+ //# sourceMappingURL=useRtl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRtl.d.ts","sourceRoot":"","sources":["../../src/hooks/useRtl.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;AAErC,eAAO,MAAM,qBAAqB,mCAAiC,CAAC;AAEpE,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAGzD;AAED,oDAAoD;AACpD,wBAAgB,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAEnD"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Chart direction context (workplan/04-widget-registry.md §7.4). Wave B widget
3
+ * wrappers bridge the i18n `dir` into this context (or pass `dir` straight to
4
+ * a chart); inside the charts package the policy is applied per scale:
5
+ * categorical x mirrors, time x never does (10-i18n-theming.md §5.5).
6
+ */
7
+ import { createContext, useContext } from 'react';
8
+ export const ChartDirectionContext = createContext('ltr');
9
+ /** Resolved direction: explicit prop wins, then the nearest provider ('ltr' default). */
10
+ export function useChartDir(override) {
11
+ const inherited = useContext(ChartDirectionContext);
12
+ return override ?? inherited;
13
+ }
14
+ /** Convenience boolean used by geometry callers. */
15
+ export function useRtl(override) {
16
+ return useChartDir(override) === 'rtl';
17
+ }
18
+ //# sourceMappingURL=useRtl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRtl.js","sourceRoot":"","sources":["../../src/hooks/useRtl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAIlD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAW,KAAK,CAAC,CAAC;AAEpE,yFAAyF;AACzF,MAAM,UAAU,WAAW,CAAC,QAAmB;IAC7C,MAAM,SAAS,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IACpD,OAAO,QAAQ,IAAI,SAAS,CAAC;AAC/B,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,MAAM,CAAC,QAAmB;IACxC,OAAO,WAAW,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC;AACzC,CAAC"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * @adminium/charts — bespoke SVG chart layer (workplan/04-widget-registry.md §7).
3
+ * No chart library: d3-scale + d3-shape math only; colors strictly via CSS
4
+ * custom properties from @adminium/tokens (viz.css). Consumers import
5
+ * '@adminium/charts/styles.css' once for the structural/motion classes.
6
+ *
7
+ * geometry/ is pure and DOM-free (server-safe for scheduled-report rendering);
8
+ * components/ are the React primitives. Storybook stories live in Wave B's
9
+ * @adminium/widgets wrappers — this package hosts vitest render tests only.
10
+ * Raster export (§7.6) is deferred; chart roots already carry data-export-node.
11
+ */
12
+ export { ChartSurface } from './components/ChartSurface.js';
13
+ export type { ChartLabels, ChartPadding, ChartRenderContext, ChartSurfaceProps, } from './components/ChartSurface.js';
14
+ export { ChartDirectionContext, useChartDir, useRtl } from './hooks/useRtl.js';
15
+ export type { ChartDir } from './hooks/useRtl.js';
16
+ export { prefersReducedMotion, useMountAnimation } from './hooks/useMountAnimation.js';
17
+ export { useMeasuredWidth } from './hooks/useChartSize.js';
18
+ export { LineAreaChart } from './components/LineAreaChart.js';
19
+ export type { LineAreaChartProps, LineAreaPoint } from './components/LineAreaChart.js';
20
+ export { BarChart } from './components/BarChart.js';
21
+ export type { BarChartProps, BarSeries } from './components/BarChart.js';
22
+ export { DonutChart } from './components/DonutChart.js';
23
+ export type { DonutChartProps } from './components/DonutChart.js';
24
+ export { Sparkline } from './components/Sparkline.js';
25
+ export type { SparklineProps, SparklineTone } from './components/Sparkline.js';
26
+ export { categoricalBandScale, categoricalPointScale, linearYScale, timeScale, } from './geometry/scales.js';
27
+ export type { CategoricalScaleOptions } from './geometry/scales.js';
28
+ export { areaPath, linePath, nearestIndexByX } from './geometry/lineArea.js';
29
+ export type { XYPoint } from './geometry/lineArea.js';
30
+ export { highlightIndex, layoutBars } from './geometry/bars.js';
31
+ export type { BarLayout, BarLayoutOptions, BarRect, CategoryCenter, HighlightMode } from './geometry/bars.js';
32
+ export { bucketSlices, donutArcs } from './geometry/donut.js';
33
+ export type { DonutArcDatum, DonutArcsOptions, DonutSliceInput } from './geometry/donut.js';
34
+ export { sparkBars, sparkLine } from './geometry/sparkline.js';
35
+ export type { SparkBar, SparkLineLayout } from './geometry/sparkline.js';
36
+ export { bins, extent, niceTicks, quantileSorted, tickStep } from './utils/stats.js';
37
+ export type { Bin } from './utils/stats.js';
38
+ export { formatCompact, formatShortDate } from './utils/format.js';
39
+ export { fnv1a, mulberry32 } from './demo/mulberry32.js';
40
+ export { DEMO_EPOCH_MS, demoCategorical, demoComparisonSeries, demoDonut, demoGroupedBars, demoSparkline, demoTimeseries, } from './demo/generators.js';
41
+ export type { DemoCategory, DemoGroupedBars, DemoPoint, DemoTimeseriesOptions } from './demo/generators.js';
42
+ export { BulletChart } from './components/BulletChart.js';
43
+ export type { BulletChartProps } from './components/BulletChart.js';
44
+ export { RankingBars } from './components/RankingBars.js';
45
+ export type { RankingBarsProps } from './components/RankingBars.js';
46
+ export { ParetoChart } from './components/ParetoChart.js';
47
+ export type { ParetoChartProps } from './components/ParetoChart.js';
48
+ export { WaterfallChart } from './components/WaterfallChart.js';
49
+ export type { WaterfallChartProps } from './components/WaterfallChart.js';
50
+ export { MarimekkoChart } from './components/MarimekkoChart.js';
51
+ export type { MarimekkoChartProps } from './components/MarimekkoChart.js';
52
+ export { StackedBar100 } from './components/StackedBar100.js';
53
+ export type { StackedBar100Props } from './components/StackedBar100.js';
54
+ export { SlopeChart } from './components/SlopeChart.js';
55
+ export type { SlopeChartProps } from './components/SlopeChart.js';
56
+ export { BoxPlotChart } from './components/BoxPlotChart.js';
57
+ export type { BoxPlotChartProps } from './components/BoxPlotChart.js';
58
+ export { ViolinChart } from './components/ViolinChart.js';
59
+ export type { ViolinChartProps } from './components/ViolinChart.js';
60
+ export { RidgelineChart } from './components/RidgelineChart.js';
61
+ export type { RidgelineChartProps } from './components/RidgelineChart.js';
62
+ export { HexbinChart } from './components/HexbinChart.js';
63
+ export type { HexbinChartProps } from './components/HexbinChart.js';
64
+ export { ScatterBubbleChart, vizColorAt } from './components/ScatterBubbleChart.js';
65
+ export type { ScatterBubbleChartProps } from './components/ScatterBubbleChart.js';
66
+ export { CorrelationMatrixChart } from './components/CorrelationMatrixChart.js';
67
+ export type { CorrelationMatrixChartProps } from './components/CorrelationMatrixChart.js';
68
+ export { ParallelCoordinatesChart } from './components/ParallelCoordinatesChart.js';
69
+ export type { ParallelCoordinatesChartProps } from './components/ParallelCoordinatesChart.js';
70
+ export type { ScatterPointInput, ParallelAxisInput, ParallelRecordInput } from './geometry/correlation.js';
71
+ export { Treemap } from './components/Treemap.js';
72
+ export type { TreemapChartProps } from './components/Treemap.js';
73
+ export { Sunburst } from './components/Sunburst.js';
74
+ export type { SunburstChartProps } from './components/Sunburst.js';
75
+ export { Funnel } from './components/Funnel.js';
76
+ export type { FunnelChartProps } from './components/Funnel.js';
77
+ export { RadialBar } from './components/RadialBar.js';
78
+ export type { RadialBarChartProps } from './components/RadialBar.js';
79
+ export { Radar } from './components/Radar.js';
80
+ export type { RadarChartProps } from './components/Radar.js';
81
+ export { Chord } from './components/Chord.js';
82
+ export type { ChordChartProps, ChordLink } from './components/Chord.js';
83
+ export { WordCloud } from './components/WordCloud.js';
84
+ export type { WordCloudChartProps } from './components/WordCloud.js';
85
+ export { CohortMatrixChart } from './components/CohortMatrixChart.js';
86
+ export type { CohortMatrixChartProps } from './components/CohortMatrixChart.js';
87
+ export { HeatCalendarChart } from './components/HeatCalendarChart.js';
88
+ export type { HeatCalendarChartProps } from './components/HeatCalendarChart.js';
89
+ export { HeatMonthChart } from './components/HeatMonthChart.js';
90
+ export type { HeatMonthChartProps } from './components/HeatMonthChart.js';
91
+ export { ChoroplethGridChart } from './components/ChoroplethGridChart.js';
92
+ export type { ChoroplethGridChartProps } from './components/ChoroplethGridChart.js';
93
+ export { hasUsTilegramTiles } from './geometry/choropleth.js';
94
+ export { SankeyChart } from './components/SankeyChart.js';
95
+ export type { SankeyChartProps } from './components/SankeyChart.js';
96
+ export { MultiLineChart } from './components/MultiLineChart.js';
97
+ export type { MultiLineChartProps, MultiLinePoint, MultiLineSeries } from './components/MultiLineChart.js';
98
+ export { StreamChart } from './components/StreamChart.js';
99
+ export type { StreamChartProps } from './components/StreamChart.js';
100
+ export { ForecastChart } from './components/ForecastChart.js';
101
+ export type { ForecastChartProps, ForecastPoint, ForecastBandPoint } from './components/ForecastChart.js';
102
+ export { AnomalyChart } from './components/AnomalyChart.js';
103
+ export type { AnomalyChartProps, AnomalyPoint } from './components/AnomalyChart.js';
104
+ export { CandlestickChart } from './components/CandlestickChart.js';
105
+ export type { CandlestickChartProps } from './components/CandlestickChart.js';
106
+ export { BumpChart } from './components/BumpChart.js';
107
+ export type { BumpChartProps } from './components/BumpChart.js';
108
+ export { TimelineLanesChart } from './components/TimelineLanesChart.js';
109
+ export type { TimelineLanesChartProps } from './components/TimelineLanesChart.js';
110
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,YAAY,EACV,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC/E,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/E,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAA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BAAwB,EAAE,MAAM,qCAAqC,CAAC;AAGpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,YAAY,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,YAAY,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @adminium/charts — bespoke SVG chart layer (workplan/04-widget-registry.md §7).
3
+ * No chart library: d3-scale + d3-shape math only; colors strictly via CSS
4
+ * custom properties from @adminium/tokens (viz.css). Consumers import
5
+ * '@adminium/charts/styles.css' once for the structural/motion classes.
6
+ *
7
+ * geometry/ is pure and DOM-free (server-safe for scheduled-report rendering);
8
+ * components/ are the React primitives. Storybook stories live in Wave B's
9
+ * @adminium/widgets wrappers — this package hosts vitest render tests only.
10
+ * Raster export (§7.6) is deferred; chart roots already carry data-export-node.
11
+ */
12
+ // Core plumbing
13
+ export { ChartSurface } from './components/ChartSurface.js';
14
+ export { ChartDirectionContext, useChartDir, useRtl } from './hooks/useRtl.js';
15
+ export { prefersReducedMotion, useMountAnimation } from './hooks/useMountAnimation.js';
16
+ export { useMeasuredWidth } from './hooks/useChartSize.js';
17
+ // Primitives
18
+ export { LineAreaChart } from './components/LineAreaChart.js';
19
+ export { BarChart } from './components/BarChart.js';
20
+ export { DonutChart } from './components/DonutChart.js';
21
+ export { Sparkline } from './components/Sparkline.js';
22
+ // Pure geometry (server-safe)
23
+ export { categoricalBandScale, categoricalPointScale, linearYScale, timeScale, } from './geometry/scales.js';
24
+ export { areaPath, linePath, nearestIndexByX } from './geometry/lineArea.js';
25
+ export { highlightIndex, layoutBars } from './geometry/bars.js';
26
+ export { bucketSlices, donutArcs } from './geometry/donut.js';
27
+ export { sparkBars, sparkLine } from './geometry/sparkline.js';
28
+ // In-package math utils (no d3-array)
29
+ export { bins, extent, niceTicks, quantileSorted, tickStep } from './utils/stats.js';
30
+ export { formatCompact, formatShortDate } from './utils/format.js';
31
+ // Deterministic seeded demo data (§7.7)
32
+ export { fnv1a, mulberry32 } from './demo/mulberry32.js';
33
+ export { DEMO_EPOCH_MS, demoCategorical, demoComparisonSeries, demoDonut, demoGroupedBars, demoSparkline, demoTimeseries, } from './demo/generators.js';
34
+ // ── M7 Wave-1 chart primitives (04-T09) ──────────────────────────────────────
35
+ // One export block per widget family; geometry stays pure/DOM-free and the
36
+ // components remain bespoke SVG (no chart library). Widget wrappers in
37
+ // @adminium/widgets lazy-import these.
38
+ // Bars & ranking
39
+ export { BulletChart } from './components/BulletChart.js';
40
+ export { RankingBars } from './components/RankingBars.js';
41
+ export { ParetoChart } from './components/ParetoChart.js';
42
+ export { WaterfallChart } from './components/WaterfallChart.js';
43
+ export { MarimekkoChart } from './components/MarimekkoChart.js';
44
+ export { StackedBar100 } from './components/StackedBar100.js';
45
+ export { SlopeChart } from './components/SlopeChart.js';
46
+ // Distribution & correlation
47
+ export { BoxPlotChart } from './components/BoxPlotChart.js';
48
+ export { ViolinChart } from './components/ViolinChart.js';
49
+ export { RidgelineChart } from './components/RidgelineChart.js';
50
+ export { HexbinChart } from './components/HexbinChart.js';
51
+ export { ScatterBubbleChart, vizColorAt } from './components/ScatterBubbleChart.js';
52
+ export { CorrelationMatrixChart } from './components/CorrelationMatrixChart.js';
53
+ export { ParallelCoordinatesChart } from './components/ParallelCoordinatesChart.js';
54
+ // Part-to-whole
55
+ export { Treemap } from './components/Treemap.js';
56
+ export { Sunburst } from './components/Sunburst.js';
57
+ export { Funnel } from './components/Funnel.js';
58
+ export { RadialBar } from './components/RadialBar.js';
59
+ export { Radar } from './components/Radar.js';
60
+ export { Chord } from './components/Chord.js';
61
+ export { WordCloud } from './components/WordCloud.js';
62
+ // Matrix & geo
63
+ export { CohortMatrixChart } from './components/CohortMatrixChart.js';
64
+ export { HeatCalendarChart } from './components/HeatCalendarChart.js';
65
+ export { HeatMonthChart } from './components/HeatMonthChart.js';
66
+ export { ChoroplethGridChart } from './components/ChoroplethGridChart.js';
67
+ // Pure geometry (server-safe): the tilegram-placeability predicate the geo
68
+ // widget uses to degrade an empty `us-tilegram` to the code-agnostic `grid`.
69
+ export { hasUsTilegramTiles } from './geometry/choropleth.js';
70
+ export { SankeyChart } from './components/SankeyChart.js';
71
+ // Time & flow (primitives; widget wrappers land in a later wave)
72
+ export { MultiLineChart } from './components/MultiLineChart.js';
73
+ export { StreamChart } from './components/StreamChart.js';
74
+ export { ForecastChart } from './components/ForecastChart.js';
75
+ export { AnomalyChart } from './components/AnomalyChart.js';
76
+ export { CandlestickChart } from './components/CandlestickChart.js';
77
+ export { BumpChart } from './components/BumpChart.js';
78
+ export { TimelineLanesChart } from './components/TimelineLanesChart.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AC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,eAAe;AACf,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,2EAA2E;AAC3E,6EAA6E;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,iEAAiE;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Compact numeral formatting for axis/legend labels ("1.2k", "3.4M"). */
2
+ export declare function formatCompact(value: number): string;
3
+ /** Short month-day label for time axes ("Mar 4"). Locale-stable (en) for demo/test use. */
4
+ export declare function formatShortDate(date: Date): string;
5
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQnD;AAOD,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAGlD"}
@@ -0,0 +1,24 @@
1
+ /** Compact numeral formatting for axis/legend labels ("1.2k", "3.4M"). */
2
+ export function formatCompact(value) {
3
+ const abs = Math.abs(value);
4
+ const sign = value < 0 ? '-' : '';
5
+ if (abs >= 1e9)
6
+ return `${sign}${trim(abs / 1e9)}B`;
7
+ if (abs >= 1e6)
8
+ return `${sign}${trim(abs / 1e6)}M`;
9
+ if (abs >= 1e3)
10
+ return `${sign}${trim(abs / 1e3)}k`;
11
+ if (Number.isInteger(value))
12
+ return String(value);
13
+ return String(Number(value.toFixed(1)));
14
+ }
15
+ function trim(scaled) {
16
+ const fixed = scaled >= 100 ? scaled.toFixed(0) : scaled.toFixed(1);
17
+ return fixed.endsWith('.0') ? fixed.slice(0, -2) : fixed;
18
+ }
19
+ /** Short month-day label for time axes ("Mar 4"). Locale-stable (en) for demo/test use. */
20
+ export function formatShortDate(date) {
21
+ const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
22
+ return `${MONTHS[date.getUTCMonth()] ?? ''} ${date.getUTCDate()}`;
23
+ }
24
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAClC,IAAI,GAAG,IAAI,GAAG;QAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;IACpD,IAAI,GAAG,IAAI,GAAG;QAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;IACpD,IAAI,GAAG,IAAI,GAAG;QAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;IACpD,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,IAAI,CAAC,MAAc;IAC1B,MAAM,KAAK,GAAG,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3D,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACpG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;AACpE,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * In-package stats helpers (~60 LOC) so @adminium/charts never pulls d3-array
3
+ * (workplan/04-widget-registry.md §7 — only d3-scale and d3-shape are allowed
4
+ * as math dependencies).
5
+ */
6
+ /** Min/max of a numeric iterable, ignoring NaN. Returns null when empty. */
7
+ export declare function extent(values: Iterable<number>): [number, number] | null;
8
+ /** d3-style tick step: powers of 10 refined by 1/2/5. Always > 0. */
9
+ export declare function tickStep(start: number, stop: number, count: number): number;
10
+ /** Round, human-friendly tick values covering [min, max] (endpoints included). */
11
+ export declare function niceTicks(min: number, max: number, count?: number): number[];
12
+ /** Linear-interpolated quantile over an ASCENDING-sorted array; p in [0, 1]. */
13
+ export declare function quantileSorted(sorted: readonly number[], p: number): number | null;
14
+ export interface Bin {
15
+ /** Inclusive lower edge. */
16
+ x0: number;
17
+ /** Exclusive upper edge (inclusive for the last bin). */
18
+ x1: number;
19
+ count: number;
20
+ }
21
+ /** Equal-width histogram bins over the data extent. */
22
+ export declare function bins(values: readonly number[], binCount?: number): Bin[];
23
+ //# sourceMappingURL=stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/utils/stats.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,4EAA4E;AAC5E,wBAAgB,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CASxE;AAED,qEAAqE;AACrE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ3E;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,MAAM,EAAE,CAWvE;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUlF;AAED,MAAM,WAAW,GAAG;IAClB,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,uDAAuD;AACvD,wBAAgB,IAAI,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,SAAK,GAAG,GAAG,EAAE,CAiBpE"}