@howells/hairline 0.0.0-stage → 0.1.0

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 (455) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +148 -2
  3. package/lib/charts/axes.js +5 -0
  4. package/lib/charts/basics/candlestick.data.js +44 -0
  5. package/lib/charts/basics/candlestick.js +180 -0
  6. package/lib/charts/basics/daily-empty.js +24 -0
  7. package/lib/charts/basics/daily-readings.js +16 -0
  8. package/lib/charts/basics/dot-heat.data.js +225 -0
  9. package/lib/charts/basics/dot-heat.js +174 -0
  10. package/lib/charts/basics/dumbbell-queue.js +203 -0
  11. package/lib/charts/basics/hairline-area.js +208 -0
  12. package/lib/charts/basics/hairline-line.js +195 -0
  13. package/lib/charts/basics/nested-treemap.data.js +55 -0
  14. package/lib/charts/basics/nested-treemap.js +191 -0
  15. package/lib/charts/basics/paired-rungs.data.js +31 -0
  16. package/lib/charts/basics/paired-rungs.js +151 -0
  17. package/lib/charts/basics/plumb-scatter.js +229 -0
  18. package/lib/charts/basics/rung-bars.js +178 -0
  19. package/lib/charts/basics/rung-geometry.js +6 -0
  20. package/lib/charts/basics/rung-histogram.data.js +73 -0
  21. package/lib/charts/basics/rung-histogram.js +153 -0
  22. package/lib/charts/basics/rung-waterfall.data.js +30 -0
  23. package/lib/charts/basics/rung-waterfall.js +150 -0
  24. package/lib/charts/basics/rungs.js +22 -0
  25. package/lib/charts/basics/series-key.js +26 -0
  26. package/lib/charts/basics/stacked-rungs.data.js +42 -0
  27. package/lib/charts/basics/stacked-rungs.js +174 -0
  28. package/lib/charts/basics/stream-ribbon.data.js +124 -0
  29. package/lib/charts/basics/stream-ribbon.js +336 -0
  30. package/lib/charts/basics/tick-box.data.js +50 -0
  31. package/lib/charts/basics/tick-box.js +226 -0
  32. package/lib/charts/basics/tick-donut.data.js +30 -0
  33. package/lib/charts/basics/tick-donut.js +210 -0
  34. package/lib/charts/basics/tick-gauge.data.js +8 -0
  35. package/lib/charts/basics/tick-gauge.js +169 -0
  36. package/lib/charts/basics/tick-rows.data.js +30 -0
  37. package/lib/charts/basics/tick-rows.js +121 -0
  38. package/lib/charts/basics/util-a.js +15 -0
  39. package/lib/charts/basics/util-b.js +13 -0
  40. package/lib/charts/big/circular-graph.data.js +827 -0
  41. package/lib/charts/big/circular-graph.js +289 -0
  42. package/lib/charts/big/force-galaxy-model.js +167 -0
  43. package/lib/charts/big/force-galaxy.data.js +813 -0
  44. package/lib/charts/big/force-galaxy.js +276 -0
  45. package/lib/charts/big/thread-triptych.data.js +204 -0
  46. package/lib/charts/big/thread-triptych.js +334 -0
  47. package/lib/charts/board/room.js +6 -0
  48. package/lib/charts/board/slope.js +176 -0
  49. package/lib/charts/board/spread.js +28 -0
  50. package/lib/charts/control.js +18 -0
  51. package/lib/charts/core.js +84 -0
  52. package/lib/charts/data-table.js +34 -0
  53. package/lib/charts/fills.js +153 -0
  54. package/lib/charts/forms/area-difference.data.js +62 -0
  55. package/lib/charts/forms/area-difference.js +192 -0
  56. package/lib/charts/forms/brush-math.js +42 -0
  57. package/lib/charts/forms/brush-strip.js +199 -0
  58. package/lib/charts/forms/brushed-overview.data.js +374 -0
  59. package/lib/charts/forms/brushed-overview.js +162 -0
  60. package/lib/charts/forms/chord-ring.data.js +140 -0
  61. package/lib/charts/forms/chord-ring.js +167 -0
  62. package/lib/charts/forms/circle-pack.data.js +80 -0
  63. package/lib/charts/forms/circle-pack.js +99 -0
  64. package/lib/charts/forms/hatched-stack.data.js +71 -0
  65. package/lib/charts/forms/hatched-stack.js +228 -0
  66. package/lib/charts/forms/radial-year.data.js +13 -0
  67. package/lib/charts/forms/radial-year.js +156 -0
  68. package/lib/charts/frame.js +73 -0
  69. package/lib/charts/glance/aggregate-sankey.data.js +74 -0
  70. package/lib/charts/glance/aggregate-sankey.js +242 -0
  71. package/lib/charts/glance/bar-race.data.js +122 -0
  72. package/lib/charts/glance/bar-race.js +246 -0
  73. package/lib/charts/glance/big-slice.data.js +41 -0
  74. package/lib/charts/glance/big-slice.js +238 -0
  75. package/lib/charts/glance/chunky-bars.data.js +22 -0
  76. package/lib/charts/glance/chunky-bars.js +113 -0
  77. package/lib/charts/glance/circular-graph.data.js +146 -0
  78. package/lib/charts/glance/circular-graph.js +138 -0
  79. package/lib/charts/glance/control-slot.js +9 -0
  80. package/lib/charts/glance/diverging-bar.data.js +34 -0
  81. package/lib/charts/glance/diverging-bar.js +154 -0
  82. package/lib/charts/glance/dot-waffle.data.js +26 -0
  83. package/lib/charts/glance/dot-waffle.js +179 -0
  84. package/lib/charts/glance/draw-in.data.js +9 -0
  85. package/lib/charts/glance/draw-in.goals.json.js +289 -0
  86. package/lib/charts/glance/draw-in.js +214 -0
  87. package/lib/charts/glance/dynamic-stream.data.js +6 -0
  88. package/lib/charts/glance/dynamic-stream.js +189 -0
  89. package/lib/charts/glance/force-graph.data.js +77 -0
  90. package/lib/charts/glance/force-graph.js +211 -0
  91. package/lib/charts/glance/jitter-strip.data.js +10 -0
  92. package/lib/charts/glance/jitter-strip.easter.json.js +430 -0
  93. package/lib/charts/glance/jitter-strip.js +157 -0
  94. package/lib/charts/glance/link-bundle.js +51 -0
  95. package/lib/charts/glance/matrix-heat-glance.data.js +108 -0
  96. package/lib/charts/glance/matrix-heat-glance.js +170 -0
  97. package/lib/charts/glance/pictorial-bar.data.js +22 -0
  98. package/lib/charts/glance/pictorial-bar.js +180 -0
  99. package/lib/charts/glance/rainfall-dual-area.data.js +177 -0
  100. package/lib/charts/glance/rainfall-dual-area.js +192 -0
  101. package/lib/charts/glance/rank-strip.data.js +76 -0
  102. package/lib/charts/glance/rank-strip.js +172 -0
  103. package/lib/charts/glance/scatter-labels.js +60 -0
  104. package/lib/charts/glance/scatter-morph.data.js +78 -0
  105. package/lib/charts/glance/scatter-morph.js +338 -0
  106. package/lib/charts/glance/single-axis.data.js +6 -0
  107. package/lib/charts/glance/single-axis.js +150 -0
  108. package/lib/charts/glance/single-axis.tides.json.js +180 -0
  109. package/lib/charts/glance/stagger-wave.data.js +66 -0
  110. package/lib/charts/glance/stagger-wave.js +132 -0
  111. package/lib/charts/glance/tree-lr.data.js +41 -0
  112. package/lib/charts/glance/tree-lr.js +135 -0
  113. package/lib/charts/glance/util-a.js +49 -0
  114. package/lib/charts/glance/util-b.js +19 -0
  115. package/lib/charts/glance/violin.data.js +9 -0
  116. package/lib/charts/glance/violin.js +185 -0
  117. package/lib/charts/glance/violin.tenors.json.js +5 -0
  118. package/lib/charts/hooks.js +154 -0
  119. package/lib/charts/hover.js +19 -0
  120. package/lib/charts/lupi/arc-matrix.data.js +83 -0
  121. package/lib/charts/lupi/arc-matrix.js +146 -0
  122. package/lib/charts/lupi/ballot-tally.data.js +22 -0
  123. package/lib/charts/lupi/ballot-tally.js +125 -0
  124. package/lib/charts/lupi/barcode-lollipop.data.js +195 -0
  125. package/lib/charts/lupi/barcode-lollipop.js +161 -0
  126. package/lib/charts/lupi/brand-spectrum.data.js +70 -0
  127. package/lib/charts/lupi/brand-spectrum.js +233 -0
  128. package/lib/charts/lupi/bubble-almanac.data.js +689 -0
  129. package/lib/charts/lupi/bubble-almanac.js +164 -0
  130. package/lib/charts/lupi/calendar-heat.data.js +399 -0
  131. package/lib/charts/lupi/calendar-heat.js +175 -0
  132. package/lib/charts/lupi/cluster-field.data.js +83 -0
  133. package/lib/charts/lupi/cluster-field.js +173 -0
  134. package/lib/charts/lupi/dot-cascade.data.js +54 -0
  135. package/lib/charts/lupi/dot-cascade.js +124 -0
  136. package/lib/charts/lupi/dotty-matrix.data.js +170 -0
  137. package/lib/charts/lupi/dotty-matrix.js +126 -0
  138. package/lib/charts/lupi/hourglass-stream.data.js +30 -0
  139. package/lib/charts/lupi/hourglass-stream.js +158 -0
  140. package/lib/charts/lupi/hundred-field.data.js +38 -0
  141. package/lib/charts/lupi/hundred-field.js +237 -0
  142. package/lib/charts/lupi/launch-fan.data.js +315 -0
  143. package/lib/charts/lupi/launch-fan.js +198 -0
  144. package/lib/charts/lupi/matrix-heat.data.js +97 -0
  145. package/lib/charts/lupi/matrix-heat.js +246 -0
  146. package/lib/charts/lupi/parallel-coordinates.data.js +54 -0
  147. package/lib/charts/lupi/parallel-coordinates.js +218 -0
  148. package/lib/charts/lupi/radial-convergence.data.js +178 -0
  149. package/lib/charts/lupi/radial-convergence.js +208 -0
  150. package/lib/charts/lupi/radial-patchwork.data.js +454 -0
  151. package/lib/charts/lupi/radial-patchwork.js +181 -0
  152. package/lib/charts/lupi/ridgeline.data.js +1834 -0
  153. package/lib/charts/lupi/ridgeline.js +195 -0
  154. package/lib/charts/lupi/trend-lineage.data.js +51 -0
  155. package/lib/charts/lupi/trend-lineage.js +198 -0
  156. package/lib/charts/lupi/type-colonnade.data.js +18 -0
  157. package/lib/charts/lupi/type-colonnade.js +198 -0
  158. package/lib/charts/lupi/util-a.js +14 -0
  159. package/lib/charts/lupi/util-b.js +12 -0
  160. package/lib/charts/maps/choropleth.js +295 -0
  161. package/lib/charts/maps/geo.js +84 -0
  162. package/lib/charts/maps/legend.js +83 -0
  163. package/lib/charts/maps/step-fill.js +9 -0
  164. package/lib/charts/maps/us-choropleth.data.js +249 -0
  165. package/lib/charts/maps/us-choropleth.js +41 -0
  166. package/lib/charts/maps/world-choropleth.data.js +681 -0
  167. package/lib/charts/maps/world-choropleth.js +46 -0
  168. package/lib/charts/markers.js +35 -0
  169. package/lib/charts/marks.js +31 -0
  170. package/lib/charts/motion.js +11 -0
  171. package/lib/charts/originals/daily-users.data.js +101 -0
  172. package/lib/charts/originals/daily-users.js +203 -0
  173. package/lib/charts/originals/feature-rank.data.js +92 -0
  174. package/lib/charts/originals/feature-rank.js +167 -0
  175. package/lib/charts/originals/format.js +5 -0
  176. package/lib/charts/originals/key.js +26 -0
  177. package/lib/charts/originals/response-time.data.js +98 -0
  178. package/lib/charts/originals/response-time.js +187 -0
  179. package/lib/charts/originals/revenue-by-plan.data.js +26 -0
  180. package/lib/charts/originals/revenue-by-plan.js +248 -0
  181. package/lib/charts/playback.js +68 -0
  182. package/lib/charts/plot-note.js +27 -0
  183. package/lib/charts/roles.js +5 -0
  184. package/lib/charts/rules.js +66 -0
  185. package/lib/charts/scale-context.js +6 -0
  186. package/lib/charts/shapes.js +8 -0
  187. package/lib/charts/shared-options.js +25 -0
  188. package/lib/charts/svg.js +43 -0
  189. package/lib/charts/text.js +30 -0
  190. package/lib/charts/texture-ids.js +20 -0
  191. package/lib/charts/texture.js +286 -0
  192. package/lib/charts/util.js +43 -0
  193. package/lib/charts/value-grid.js +26 -0
  194. package/lib/draw.js +27 -0
  195. package/lib/entries/dumbbell-queue.js +2 -0
  196. package/lib/entries/hairline-area.js +2 -0
  197. package/lib/entries/hairline-line.js +2 -0
  198. package/lib/entries/plumb-scatter.js +2 -0
  199. package/lib/entries/rung-bars.js +2 -0
  200. package/lib/entries/slope.js +2 -0
  201. package/lib/frame.js +2 -0
  202. package/lib/hairline.css +1385 -0
  203. package/lib/index.js +72 -0
  204. package/lib/json-schema/dumbbell-queue.json +258 -0
  205. package/lib/json-schema/hairline-area.json +262 -0
  206. package/lib/json-schema/hairline-line.json +256 -0
  207. package/lib/json-schema/index.json +50 -0
  208. package/lib/json-schema/plumb-scatter.json +363 -0
  209. package/lib/json-schema/rung-bars.json +230 -0
  210. package/lib/json-schema/slope.json +333 -0
  211. package/lib/kit.js +16 -0
  212. package/lib/lib/format.js +29 -0
  213. package/lib/lib/random.js +8 -0
  214. package/lib/maps.js +4 -0
  215. package/lib/schema/daily.js +9 -0
  216. package/lib/schema/dumbbell-queue.js +28 -0
  217. package/lib/schema/format.js +72 -0
  218. package/lib/schema/hairline-area.js +24 -0
  219. package/lib/schema/hairline-line.js +23 -0
  220. package/lib/schema/key.js +4 -0
  221. package/lib/schema/metrics.js +26 -0
  222. package/lib/schema/motion.js +12 -0
  223. package/lib/schema/options.js +21 -0
  224. package/lib/schema/plumb-scatter.js +48 -0
  225. package/lib/schema/registry.js +132 -0
  226. package/lib/schema/rung-bars.js +25 -0
  227. package/lib/schema/scale.js +9 -0
  228. package/lib/schema/slope.js +28 -0
  229. package/lib/schema/validate.js +25 -0
  230. package/lib/schema.js +16 -0
  231. package/lib/theme/derive.js +98 -0
  232. package/lib/theme.css +443 -0
  233. package/lib/theme.js +1 -0
  234. package/lib/tokens.css +306 -0
  235. package/lib/types/charts/axes.d.ts +14 -0
  236. package/lib/types/charts/basics/candlestick.d.ts +22 -0
  237. package/lib/types/charts/basics/candlestick.data.d.ts +10 -0
  238. package/lib/types/charts/basics/daily-empty.d.ts +7 -0
  239. package/lib/types/charts/basics/daily-readings.d.ts +38 -0
  240. package/lib/types/charts/basics/dot-heat.d.ts +19 -0
  241. package/lib/types/charts/basics/dot-heat.data.d.ts +28 -0
  242. package/lib/types/charts/basics/dumbbell-queue.d.ts +15 -0
  243. package/lib/types/charts/basics/hairline-area.d.ts +18 -0
  244. package/lib/types/charts/basics/hairline-line.d.ts +18 -0
  245. package/lib/types/charts/basics/nested-treemap.d.ts +18 -0
  246. package/lib/types/charts/basics/nested-treemap.data.d.ts +30 -0
  247. package/lib/types/charts/basics/paired-rungs.d.ts +21 -0
  248. package/lib/types/charts/basics/paired-rungs.data.d.ts +43 -0
  249. package/lib/types/charts/basics/plumb-scatter.d.ts +14 -0
  250. package/lib/types/charts/basics/rung-bars.d.ts +16 -0
  251. package/lib/types/charts/basics/rung-geometry.d.ts +6 -0
  252. package/lib/types/charts/basics/rung-histogram.d.ts +22 -0
  253. package/lib/types/charts/basics/rung-histogram.data.d.ts +34 -0
  254. package/lib/types/charts/basics/rung-waterfall.d.ts +19 -0
  255. package/lib/types/charts/basics/rung-waterfall.data.d.ts +31 -0
  256. package/lib/types/charts/basics/rungs.d.ts +28 -0
  257. package/lib/types/charts/basics/series-key.d.ts +19 -0
  258. package/lib/types/charts/basics/stacked-rungs.d.ts +20 -0
  259. package/lib/types/charts/basics/stacked-rungs.data.d.ts +26 -0
  260. package/lib/types/charts/basics/stream-ribbon.d.ts +19 -0
  261. package/lib/types/charts/basics/stream-ribbon.data.d.ts +29 -0
  262. package/lib/types/charts/basics/tick-box.d.ts +19 -0
  263. package/lib/types/charts/basics/tick-box.data.d.ts +30 -0
  264. package/lib/types/charts/basics/tick-donut.d.ts +24 -0
  265. package/lib/types/charts/basics/tick-donut.data.d.ts +25 -0
  266. package/lib/types/charts/basics/tick-gauge.d.ts +22 -0
  267. package/lib/types/charts/basics/tick-gauge.data.d.ts +24 -0
  268. package/lib/types/charts/basics/tick-rows.d.ts +18 -0
  269. package/lib/types/charts/basics/tick-rows.data.d.ts +23 -0
  270. package/lib/types/charts/basics/util-a.d.ts +10 -0
  271. package/lib/types/charts/basics/util-b.d.ts +13 -0
  272. package/lib/types/charts/big/circular-graph.d.ts +20 -0
  273. package/lib/types/charts/big/circular-graph.data.d.ts +46 -0
  274. package/lib/types/charts/big/force-galaxy-model.d.ts +109 -0
  275. package/lib/types/charts/big/force-galaxy.d.ts +18 -0
  276. package/lib/types/charts/big/force-galaxy.data.d.ts +48 -0
  277. package/lib/types/charts/big/thread-triptych.d.ts +17 -0
  278. package/lib/types/charts/big/thread-triptych.data.d.ts +41 -0
  279. package/lib/types/charts/board/room.d.ts +18 -0
  280. package/lib/types/charts/board/slope.d.ts +14 -0
  281. package/lib/types/charts/board/spread.d.ts +5 -0
  282. package/lib/types/charts/control.d.ts +17 -0
  283. package/lib/types/charts/core.d.ts +77 -0
  284. package/lib/types/charts/data-table.d.ts +18 -0
  285. package/lib/types/charts/fills.d.ts +103 -0
  286. package/lib/types/charts/forms/area-difference.d.ts +9 -0
  287. package/lib/types/charts/forms/area-difference.data.d.ts +26 -0
  288. package/lib/types/charts/forms/brush-math.d.ts +19 -0
  289. package/lib/types/charts/forms/brush-strip.d.ts +19 -0
  290. package/lib/types/charts/forms/brushed-overview.d.ts +12 -0
  291. package/lib/types/charts/forms/brushed-overview.data.d.ts +16 -0
  292. package/lib/types/charts/forms/chord-ring.d.ts +12 -0
  293. package/lib/types/charts/forms/chord-ring.data.d.ts +29 -0
  294. package/lib/types/charts/forms/circle-pack.d.ts +9 -0
  295. package/lib/types/charts/forms/circle-pack.data.d.ts +23 -0
  296. package/lib/types/charts/forms/hatched-stack.d.ts +10 -0
  297. package/lib/types/charts/forms/hatched-stack.data.d.ts +36 -0
  298. package/lib/types/charts/forms/radial-year.d.ts +8 -0
  299. package/lib/types/charts/forms/radial-year.data.d.ts +17 -0
  300. package/lib/types/charts/frame.d.ts +21 -0
  301. package/lib/types/charts/glance/aggregate-sankey.d.ts +23 -0
  302. package/lib/types/charts/glance/aggregate-sankey.data.d.ts +32 -0
  303. package/lib/types/charts/glance/bar-race.d.ts +20 -0
  304. package/lib/types/charts/glance/bar-race.data.d.ts +32 -0
  305. package/lib/types/charts/glance/big-slice.d.ts +27 -0
  306. package/lib/types/charts/glance/big-slice.data.d.ts +30 -0
  307. package/lib/types/charts/glance/chunky-bars.d.ts +18 -0
  308. package/lib/types/charts/glance/chunky-bars.data.d.ts +24 -0
  309. package/lib/types/charts/glance/circular-graph.d.ts +19 -0
  310. package/lib/types/charts/glance/circular-graph.data.d.ts +43 -0
  311. package/lib/types/charts/glance/control-slot.d.ts +9 -0
  312. package/lib/types/charts/glance/diverging-bar.d.ts +19 -0
  313. package/lib/types/charts/glance/diverging-bar.data.d.ts +27 -0
  314. package/lib/types/charts/glance/dot-waffle.d.ts +19 -0
  315. package/lib/types/charts/glance/dot-waffle.data.d.ts +31 -0
  316. package/lib/types/charts/glance/draw-in.d.ts +20 -0
  317. package/lib/types/charts/glance/draw-in.data.d.ts +6 -0
  318. package/lib/types/charts/glance/dynamic-stream.d.ts +22 -0
  319. package/lib/types/charts/glance/dynamic-stream.data.d.ts +7 -0
  320. package/lib/types/charts/glance/force-graph.d.ts +16 -0
  321. package/lib/types/charts/glance/force-graph.data.d.ts +45 -0
  322. package/lib/types/charts/glance/jitter-strip.d.ts +24 -0
  323. package/lib/types/charts/glance/jitter-strip.data.d.ts +27 -0
  324. package/lib/types/charts/glance/link-bundle.d.ts +22 -0
  325. package/lib/types/charts/glance/matrix-heat-glance.d.ts +22 -0
  326. package/lib/types/charts/glance/matrix-heat-glance.data.d.ts +35 -0
  327. package/lib/types/charts/glance/pictorial-bar.d.ts +20 -0
  328. package/lib/types/charts/glance/pictorial-bar.data.d.ts +27 -0
  329. package/lib/types/charts/glance/rainfall-dual-area.d.ts +19 -0
  330. package/lib/types/charts/glance/rainfall-dual-area.data.d.ts +32 -0
  331. package/lib/types/charts/glance/rank-strip.d.ts +19 -0
  332. package/lib/types/charts/glance/rank-strip.data.d.ts +36 -0
  333. package/lib/types/charts/glance/scatter-labels.d.ts +23 -0
  334. package/lib/types/charts/glance/scatter-morph.d.ts +22 -0
  335. package/lib/types/charts/glance/scatter-morph.data.d.ts +30 -0
  336. package/lib/types/charts/glance/single-axis.d.ts +27 -0
  337. package/lib/types/charts/glance/single-axis.data.d.ts +6 -0
  338. package/lib/types/charts/glance/stagger-wave.d.ts +18 -0
  339. package/lib/types/charts/glance/stagger-wave.data.d.ts +26 -0
  340. package/lib/types/charts/glance/tree-lr.d.ts +16 -0
  341. package/lib/types/charts/glance/tree-lr.data.d.ts +27 -0
  342. package/lib/types/charts/glance/util-a.d.ts +31 -0
  343. package/lib/types/charts/glance/util-b.d.ts +12 -0
  344. package/lib/types/charts/glance/violin.d.ts +22 -0
  345. package/lib/types/charts/glance/violin.data.d.ts +24 -0
  346. package/lib/types/charts/hooks.d.ts +109 -0
  347. package/lib/types/charts/hover.d.ts +26 -0
  348. package/lib/types/charts/lupi/arc-matrix.d.ts +18 -0
  349. package/lib/types/charts/lupi/arc-matrix.data.d.ts +28 -0
  350. package/lib/types/charts/lupi/ballot-tally.d.ts +19 -0
  351. package/lib/types/charts/lupi/ballot-tally.data.d.ts +28 -0
  352. package/lib/types/charts/lupi/barcode-lollipop.d.ts +19 -0
  353. package/lib/types/charts/lupi/barcode-lollipop.data.d.ts +26 -0
  354. package/lib/types/charts/lupi/brand-spectrum.d.ts +28 -0
  355. package/lib/types/charts/lupi/brand-spectrum.data.d.ts +34 -0
  356. package/lib/types/charts/lupi/bubble-almanac.d.ts +22 -0
  357. package/lib/types/charts/lupi/bubble-almanac.data.d.ts +45 -0
  358. package/lib/types/charts/lupi/calendar-heat.d.ts +19 -0
  359. package/lib/types/charts/lupi/calendar-heat.data.d.ts +20 -0
  360. package/lib/types/charts/lupi/cluster-field.d.ts +21 -0
  361. package/lib/types/charts/lupi/cluster-field.data.d.ts +52 -0
  362. package/lib/types/charts/lupi/dot-cascade.d.ts +22 -0
  363. package/lib/types/charts/lupi/dot-cascade.data.d.ts +24 -0
  364. package/lib/types/charts/lupi/dotty-matrix.d.ts +17 -0
  365. package/lib/types/charts/lupi/dotty-matrix.data.d.ts +32 -0
  366. package/lib/types/charts/lupi/hourglass-stream.d.ts +18 -0
  367. package/lib/types/charts/lupi/hourglass-stream.data.d.ts +27 -0
  368. package/lib/types/charts/lupi/hundred-field.d.ts +18 -0
  369. package/lib/types/charts/lupi/hundred-field.data.d.ts +24 -0
  370. package/lib/types/charts/lupi/launch-fan.d.ts +37 -0
  371. package/lib/types/charts/lupi/launch-fan.data.d.ts +41 -0
  372. package/lib/types/charts/lupi/matrix-heat.d.ts +20 -0
  373. package/lib/types/charts/lupi/matrix-heat.data.d.ts +29 -0
  374. package/lib/types/charts/lupi/parallel-coordinates.d.ts +23 -0
  375. package/lib/types/charts/lupi/parallel-coordinates.data.d.ts +40 -0
  376. package/lib/types/charts/lupi/radial-convergence.d.ts +15 -0
  377. package/lib/types/charts/lupi/radial-convergence.data.d.ts +24 -0
  378. package/lib/types/charts/lupi/radial-patchwork.d.ts +16 -0
  379. package/lib/types/charts/lupi/radial-patchwork.data.d.ts +35 -0
  380. package/lib/types/charts/lupi/ridgeline.d.ts +23 -0
  381. package/lib/types/charts/lupi/ridgeline.data.d.ts +19 -0
  382. package/lib/types/charts/lupi/trend-lineage.d.ts +18 -0
  383. package/lib/types/charts/lupi/trend-lineage.data.d.ts +56 -0
  384. package/lib/types/charts/lupi/type-colonnade.d.ts +20 -0
  385. package/lib/types/charts/lupi/type-colonnade.data.d.ts +30 -0
  386. package/lib/types/charts/lupi/util-a.d.ts +9 -0
  387. package/lib/types/charts/lupi/util-b.d.ts +11 -0
  388. package/lib/types/charts/maps/choropleth.d.ts +33 -0
  389. package/lib/types/charts/maps/geo.d.ts +48 -0
  390. package/lib/types/charts/maps/legend.d.ts +14 -0
  391. package/lib/types/charts/maps/step-fill.d.ts +6 -0
  392. package/lib/types/charts/maps/us-choropleth.d.ts +25 -0
  393. package/lib/types/charts/maps/us-choropleth.data.d.ts +23 -0
  394. package/lib/types/charts/maps/world-choropleth.d.ts +22 -0
  395. package/lib/types/charts/maps/world-choropleth.data.d.ts +35 -0
  396. package/lib/types/charts/markers.d.ts +42 -0
  397. package/lib/types/charts/marks.d.ts +58 -0
  398. package/lib/types/charts/motion.d.ts +12 -0
  399. package/lib/types/charts/originals/daily-users.d.ts +13 -0
  400. package/lib/types/charts/originals/daily-users.data.d.ts +17 -0
  401. package/lib/types/charts/originals/feature-rank.d.ts +13 -0
  402. package/lib/types/charts/originals/feature-rank.data.d.ts +29 -0
  403. package/lib/types/charts/originals/format.d.ts +2 -0
  404. package/lib/types/charts/originals/key.d.ts +16 -0
  405. package/lib/types/charts/originals/response-time.d.ts +11 -0
  406. package/lib/types/charts/originals/response-time.data.d.ts +24 -0
  407. package/lib/types/charts/originals/revenue-by-plan.d.ts +12 -0
  408. package/lib/types/charts/originals/revenue-by-plan.data.d.ts +26 -0
  409. package/lib/types/charts/playback.d.ts +42 -0
  410. package/lib/types/charts/plot-note.d.ts +37 -0
  411. package/lib/types/charts/roles.d.ts +28 -0
  412. package/lib/types/charts/rules.d.ts +62 -0
  413. package/lib/types/charts/scale-context.d.ts +3 -0
  414. package/lib/types/charts/shapes.d.ts +9 -0
  415. package/lib/types/charts/shared-options.d.ts +25 -0
  416. package/lib/types/charts/svg.d.ts +24 -0
  417. package/lib/types/charts/text.d.ts +36 -0
  418. package/lib/types/charts/texture-ids.d.ts +24 -0
  419. package/lib/types/charts/texture.d.ts +185 -0
  420. package/lib/types/charts/util.d.ts +66 -0
  421. package/lib/types/charts/value-grid.d.ts +22 -0
  422. package/lib/types/draw.d.ts +279 -0
  423. package/lib/types/entries/dumbbell-queue.d.ts +2 -0
  424. package/lib/types/entries/hairline-area.d.ts +2 -0
  425. package/lib/types/entries/hairline-line.d.ts +2 -0
  426. package/lib/types/entries/plumb-scatter.d.ts +2 -0
  427. package/lib/types/entries/rung-bars.d.ts +2 -0
  428. package/lib/types/entries/slope.d.ts +2 -0
  429. package/lib/types/frame.d.ts +2 -0
  430. package/lib/types/index.d.ts +82 -0
  431. package/lib/types/kit.d.ts +22 -0
  432. package/lib/types/lib/format.d.ts +58 -0
  433. package/lib/types/lib/random.d.ts +5 -0
  434. package/lib/types/maps.d.ts +2 -0
  435. package/lib/types/schema/daily.d.ts +14 -0
  436. package/lib/types/schema/dumbbell-queue.d.ts +91 -0
  437. package/lib/types/schema/format.d.ts +101 -0
  438. package/lib/types/schema/hairline-area.d.ts +83 -0
  439. package/lib/types/schema/hairline-line.d.ts +85 -0
  440. package/lib/types/schema/key.d.ts +12 -0
  441. package/lib/types/schema/metrics.d.ts +26 -0
  442. package/lib/types/schema/motion.d.ts +22 -0
  443. package/lib/types/schema/options.d.ts +51 -0
  444. package/lib/types/schema/plumb-scatter.d.ts +124 -0
  445. package/lib/types/schema/registry.d.ts +309 -0
  446. package/lib/types/schema/rung-bars.d.ts +84 -0
  447. package/lib/types/schema/scale.d.ts +34 -0
  448. package/lib/types/schema/slope.d.ts +120 -0
  449. package/lib/types/schema/validate.d.ts +29 -0
  450. package/lib/types/schema.d.ts +30 -0
  451. package/lib/types/theme/derive.d.ts +23 -0
  452. package/lib/types/theme.d.ts +2 -0
  453. package/lib/vendor/us-atlas/states-10m.json.js +13855 -0
  454. package/lib/vendor/world-atlas/countries-110m.json.js +9357 -0
  455. package/package.json +162 -4
@@ -0,0 +1,156 @@
1
+ "use client";
2
+ import { fmtDegC as e, fmtMonth as t, monthTickLabels as n } from "../../lib/format.js";
3
+ import { useHover as r } from "../hooks.js";
4
+ import { Plot as i, Tooltip as a } from "../core.js";
5
+ import { stagger as o } from "../util.js";
6
+ import { TipText as s } from "../hover.js";
7
+ import { RING_STEP as c } from "../marks.js";
8
+ import { Dot as l } from "../markers.js";
9
+ import { ChartSvg as u } from "../svg.js";
10
+ import { Label as d } from "../text.js";
11
+ import { paint as f, useTextureIds as p } from "../texture-ids.js";
12
+ import { DotRing as m, Hatch as h, PlateLabel as g } from "../texture.js";
13
+ import { signupMonthsDemo as _ } from "./radial-year.data.js";
14
+ import { scaleLinear as v } from "d3-scale";
15
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
16
+ import { curveCatmullRomClosed as x, lineRadial as S } from "d3-shape";
17
+ //#region src/charts/forms/radial-year.tsx
18
+ var C = e, w = (t) => e(t).replace(".0 °C", " °C"), T = 30, E = (e, t) => e / t * Math.PI * 2, D = Math.PI / 12, O = (e, t) => ({
19
+ x: Math.sin(e) * t,
20
+ y: -Math.cos(e) * t
21
+ }), k = 10, A = 7.5, j = (e) => {
22
+ let t = e.data.length, n = (n) => {
23
+ let r = (n + t) % t;
24
+ return O(E(r, t), e.r(e.data[r].value));
25
+ }, [r, i, a, o] = [
26
+ n(-1),
27
+ n(0),
28
+ n(1),
29
+ n(2)
30
+ ];
31
+ return Math.hypot((9 * (i.x + a.x) - r.x - o.x) / 16, (9 * (i.y + a.y) - r.y - o.y) / 16);
32
+ }, M = (e) => {
33
+ let t = e.data.length, r = n(e.data.map((e) => e.date)), i = j(e);
34
+ return /* @__PURE__ */ b("g", { children: [e.rings.map((t) => {
35
+ let n = O(D, e.r(t) - k), r = i > e.r(t) - k - A;
36
+ return /* @__PURE__ */ b("g", { children: [/* @__PURE__ */ y(m, {
37
+ cx: 0,
38
+ cy: 0,
39
+ r: e.r(t),
40
+ step: c.guide,
41
+ tone: "fill-l4"
42
+ }), r ? /* @__PURE__ */ y(g, {
43
+ className: "t-axis",
44
+ text: w(t),
45
+ x: n.x,
46
+ y: n.y
47
+ }) : /* @__PURE__ */ y(d, {
48
+ anchor: "middle",
49
+ halo: !0,
50
+ middle: !0,
51
+ voice: "axis",
52
+ x: n.x,
53
+ y: n.y,
54
+ children: w(t)
55
+ })] }, t);
56
+ }), e.data.map((n, i) => {
57
+ let a = O(E(i, t), e.outer + T / 2);
58
+ return /* @__PURE__ */ y(d, {
59
+ anchor: "middle",
60
+ middle: !0,
61
+ voice: e.hover === i ? "label" : "axis",
62
+ x: a.x,
63
+ y: a.y,
64
+ children: r[i]
65
+ }, n.date.toISOString());
66
+ })] });
67
+ }, N = (e) => S().curve(x.alpha(.5)).angle((t, n) => E(n, e.data.length)).radius((t) => e.r(t.value))(e.data) ?? "", P = (e) => /* @__PURE__ */ y("path", {
68
+ className: "fade",
69
+ d: N(e),
70
+ fill: f(e.hatch)
71
+ }), F = (e) => {
72
+ let t = e.data.length, n = N(e), r = e.data[e.peak], i = O(E(e.peak, t), e.r(r.value)), a = e.hover === null ? null : O(E(e.hover, t), e.r(e.data[e.hover].value));
73
+ return /* @__PURE__ */ b("g", { children: [
74
+ /* @__PURE__ */ y("path", {
75
+ className: "draw stroke-l3 stroke-medium cap-round fill-none",
76
+ d: n,
77
+ pathLength: 1
78
+ }),
79
+ a === null ? null : /* @__PURE__ */ y(l, {
80
+ className: "fill-l2",
81
+ cx: a.x,
82
+ cy: a.y,
83
+ size: "sm"
84
+ }),
85
+ /* @__PURE__ */ y(l, {
86
+ className: "pop fill-hero",
87
+ cx: i.x,
88
+ cy: i.y,
89
+ size: "md",
90
+ style: o(4, "series")
91
+ }),
92
+ /* @__PURE__ */ y(d, {
93
+ anchor: i.x >= 0 ? "start" : "end",
94
+ dx: i.x >= 0 ? 10 : -10,
95
+ halo: !0,
96
+ middle: !0,
97
+ order: 4,
98
+ tier: "series",
99
+ voice: "value",
100
+ x: i.x,
101
+ y: i.y,
102
+ children: C(r.value)
103
+ })
104
+ ] });
105
+ }, I = (e) => {
106
+ let n = e.data ?? _, o = r(), c = p("year")("hatch"), l = n.map((e) => e.value), d = l.indexOf(Math.max(...l));
107
+ return /* @__PURE__ */ y(i, {
108
+ overlay: o.at === null ? null : /* @__PURE__ */ y(a, {
109
+ x: o.at.x,
110
+ y: o.at.y,
111
+ children: /* @__PURE__ */ y(s, {
112
+ facts: [`${C(n[o.at.key].value)} mean daily maximum`],
113
+ lead: t(n[o.at.key].date)
114
+ })
115
+ }),
116
+ children: (e) => {
117
+ let r = Math.min(e, 460), i = r / 2 - T, a = v().domain([0, Math.max(...l)]).nice(3).range([0, i]), s = a.ticks(3).filter((e) => e > 0), f = Math.round(e / 2), p = Math.round(r / 2), m = `Mean daily maximum temperature by month, 2022: warmest ${C(n[d].value)} in ${t(n[d].date)}`, g = (e) => {
118
+ let t = e.currentTarget.getBoundingClientRect(), r = e.clientX - t.left - f, i = e.clientY - t.top - p, s = (Math.atan2(r, -i) + Math.PI * 2) % (Math.PI * 2), c = Math.round(s / (Math.PI * 2) * n.length) % n.length, l = O(E(c, n.length), a(n[c].value));
119
+ o.show(c, f + l.x, p + l.y - 10);
120
+ }, _ = {
121
+ data: n,
122
+ hover: o.key,
123
+ outer: a(a.domain()[1]),
124
+ r: a,
125
+ rings: s
126
+ };
127
+ return /* @__PURE__ */ b(u, {
128
+ className: "touch-pan-y",
129
+ height: r,
130
+ label: m,
131
+ leave: o.clear,
132
+ onPointerMove: g,
133
+ width: e,
134
+ children: [/* @__PURE__ */ y("defs", { children: /* @__PURE__ */ y(h, {
135
+ id: c,
136
+ tone: "fill-l5"
137
+ }) }), /* @__PURE__ */ b("g", {
138
+ transform: `translate(${f} ${p})`,
139
+ children: [
140
+ /* @__PURE__ */ y(P, {
141
+ ..._,
142
+ hatch: c
143
+ }),
144
+ /* @__PURE__ */ y(M, { ..._ }),
145
+ /* @__PURE__ */ y(F, {
146
+ ..._,
147
+ peak: d
148
+ })
149
+ ]
150
+ })]
151
+ });
152
+ }
153
+ });
154
+ };
155
+ //#endregion
156
+ export { I as RadialYear };
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { useId as e } from "react";
3
+ import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ //#region src/charts/frame.tsx
5
+ var i = (e) => /* @__PURE__ */ r("svg", {
6
+ "aria-hidden": !0,
7
+ className: "size-4",
8
+ fill: "none",
9
+ style: { anchorName: e.anchor },
10
+ viewBox: "0 0 16 16",
11
+ children: [
12
+ /* @__PURE__ */ n("circle", {
13
+ cx: "8",
14
+ cy: "8",
15
+ r: "6.5",
16
+ stroke: "currentColor"
17
+ }),
18
+ /* @__PURE__ */ n("circle", {
19
+ cx: "8",
20
+ cy: "5.25",
21
+ fill: "currentColor",
22
+ r: "0.85"
23
+ }),
24
+ /* @__PURE__ */ n("path", {
25
+ d: "M8 7.5v4",
26
+ stroke: "currentColor",
27
+ strokeLinecap: "round"
28
+ })
29
+ ]
30
+ }), a = (a) => {
31
+ let o = `hl-note-${e().replaceAll(/[^\w-]/gu, "")}`, s = a.source !== void 0 || a.footnote !== void 0;
32
+ return /* @__PURE__ */ r("figure", {
33
+ "aria-label": a.name,
34
+ className: "m-0 flex min-w-0 flex-col gap-8",
35
+ children: [
36
+ /* @__PURE__ */ r("figcaption", {
37
+ className: "text-text text-small flex items-center justify-between gap-4",
38
+ children: [a.name, a.note === void 0 ? null : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("button", {
39
+ "aria-label": `About ${a.name}`,
40
+ className: "text-muted hover:text-text focus-visible:outline-muted [&:has(+:popover-open)]:text-text -my-3 -mr-3.5 inline-flex size-11 shrink-0 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent p-0 transition-colors focus-visible:outline-1 focus-visible:-outline-offset-8 focus-visible:outline-solid",
41
+ popoverTarget: o,
42
+ type: "button",
43
+ children: /* @__PURE__ */ n(i, { anchor: `--${o}` })
44
+ }), /* @__PURE__ */ n("div", {
45
+ className: "note-pop rounded-tip bg-ink text-paper text-small border-0 p-4",
46
+ id: o,
47
+ popover: "auto",
48
+ style: { positionAnchor: `--${o}` },
49
+ children: /* @__PURE__ */ n("p", {
50
+ className: "m-0",
51
+ children: a.note
52
+ })
53
+ })] })]
54
+ }),
55
+ /* @__PURE__ */ n("div", {
56
+ className: "flex min-w-0 flex-1 flex-col justify-center",
57
+ children: a.children
58
+ }),
59
+ s ? /* @__PURE__ */ r("footer", {
60
+ className: "text-muted text-small flex flex-col gap-1",
61
+ children: [a.source === void 0 ? null : /* @__PURE__ */ n("p", {
62
+ className: "m-0",
63
+ children: a.source
64
+ }), a.footnote === void 0 ? null : /* @__PURE__ */ n("p", {
65
+ className: "m-0",
66
+ children: a.footnote
67
+ })]
68
+ }) : null
69
+ ]
70
+ });
71
+ };
72
+ //#endregion
73
+ export { a as Frame };
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ //#region src/charts/glance/aggregate-sankey.data.ts
3
+ var e = {
4
+ flows: [
5
+ {
6
+ from: "Labour",
7
+ to: "Aye",
8
+ value: 234
9
+ },
10
+ {
11
+ from: "Labour",
12
+ to: "No",
13
+ value: 147
14
+ },
15
+ {
16
+ from: "Labour",
17
+ to: "Did not vote",
18
+ value: 18
19
+ },
20
+ {
21
+ from: "Conservative",
22
+ to: "Aye",
23
+ value: 23
24
+ },
25
+ {
26
+ from: "Conservative",
27
+ to: "No",
28
+ value: 92
29
+ },
30
+ {
31
+ from: "Conservative",
32
+ to: "Did not vote",
33
+ value: 3
34
+ },
35
+ {
36
+ from: "Liberal Democrat",
37
+ to: "Aye",
38
+ value: 61
39
+ },
40
+ {
41
+ from: "Liberal Democrat",
42
+ to: "No",
43
+ value: 11
44
+ },
45
+ {
46
+ from: "Other",
47
+ to: "Aye",
48
+ value: 12
49
+ },
50
+ {
51
+ from: "Other",
52
+ to: "No",
53
+ value: 25
54
+ },
55
+ {
56
+ from: "Other",
57
+ to: "Did not vote",
58
+ value: 21
59
+ }
60
+ ],
61
+ sources: [
62
+ "Labour",
63
+ "Conservative",
64
+ "Liberal Democrat",
65
+ "Other"
66
+ ],
67
+ targets: [
68
+ "Aye",
69
+ "No",
70
+ "Did not vote"
71
+ ]
72
+ };
73
+ //#endregion
74
+ export { e as aggregateSankeyDemo };
@@ -0,0 +1,242 @@
1
+ "use client";
2
+ import { Plot as e, Tooltip as t } from "../core.js";
3
+ import { noteOf as n, noteSpace as r, ranks as i, stagger as a, wrapWords as o } from "../util.js";
4
+ import { DimGroup as s, TipText as c } from "../hover.js";
5
+ import { crisp as l } from "../axes.js";
6
+ import { FootNote as u } from "../plot-note.js";
7
+ import { ChartSvg as d } from "../svg.js";
8
+ import { Label as f } from "../text.js";
9
+ import { paint as p, useTextureIds as m } from "../texture-ids.js";
10
+ import { CrossHatch as h, Hatch as g, Rules as _, Stipple as v } from "../texture.js";
11
+ import { aggregateSankeyDemo as y } from "./aggregate-sankey.data.js";
12
+ import { textWidth as b } from "./util-a.js";
13
+ import { useState as x } from "react";
14
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
15
+ import { sankey as w, sankeyLinkHorizontal as T } from "d3-sankey";
16
+ //#region src/charts/glance/aggregate-sankey.tsx
17
+ var E = (e) => Math.round(e).toLocaleString("en-GB"), D = [
18
+ "falling",
19
+ "rising",
20
+ "dots",
21
+ "rule"
22
+ ], O = 12, k = 4, A = 13, j = (e) => b(e, "t-label"), M = (e, t, n, r) => {
23
+ let i = Math.max(n ? 84 : 128, t * .4) - O - k, a = new Map(e.sources.map((e) => {
24
+ let t = `${e} · ${r(e)}`;
25
+ return [e, j(t) <= i ? [t] : [...o(e, i, j), r(e)]];
26
+ })), s = Math.max(0, ...[...a.values()].flat().map((e) => j(e))), c = Math.max(0, ...e.targets.map((e) => j(`${e} ${r(e)}`) + 6)), l = Math.ceil(s) + O + k, u = Math.ceil(c) + O + k, d = Math.max(0, (n ? 84 : 128) - l, (n ? 52 : 92) - u);
27
+ return {
28
+ left: l + d,
29
+ right: u + d,
30
+ sourceLines: a
31
+ };
32
+ }, N = (e, t, n, r, i, a) => {
33
+ let o = {
34
+ left: a.left,
35
+ right: a.right,
36
+ top: 8
37
+ }, s = [...e.sources.map((e, t) => ({
38
+ id: `s:${e}`,
39
+ index: t,
40
+ name: e,
41
+ side: "source"
42
+ })), ...e.targets.map((e, t) => ({
43
+ id: `t:${e}`,
44
+ index: t,
45
+ name: e,
46
+ side: "target"
47
+ }))], c = e.flows.map((e) => ({
48
+ from: e.from,
49
+ source: `s:${e.from}`,
50
+ target: `t:${e.to}`,
51
+ to: e.to,
52
+ value: e.value
53
+ }));
54
+ return w().nodeId((e) => e.id).nodeWidth(r ? 10 : 15).nodePadding(r ? 12 : 16).nodeSort((e, t) => e.index - t.index).extent([[o.left, o.top], [t - o.right, n - i]])({
55
+ links: c,
56
+ nodes: s
57
+ });
58
+ }, P = (e, t, n) => e === null ? !0 : e.flow === null ? t.from === e.node || t.to === e.node : e.flow === n, F = (e, t) => e === null ? {
59
+ face: "",
60
+ ribbon: ""
61
+ } : t ? {
62
+ face: "stroke-l3",
63
+ ribbon: ""
64
+ } : {
65
+ face: "",
66
+ ribbon: "opacity-30"
67
+ }, I = (e, t, n) => {
68
+ if (e === null || e.node === n) return !0;
69
+ if (e.flow === null) return !1;
70
+ let r = t.flows[e.flow];
71
+ return r.from === n || r.to === n;
72
+ }, L = (e) => {
73
+ let t = T(), n = e.graph.links.map((e, t) => ({
74
+ k: t,
75
+ l: e
76
+ })).toSorted((t, n) => Number(e.grainOf(t.l.from) === e.heroGrain) - Number(e.grainOf(n.l.from) === e.heroGrain));
77
+ return /* @__PURE__ */ S("g", { children: n.map(({ l: n, k: r }) => {
78
+ let i = F(e.focus, P(e.focus, e.data.flows[r], r));
79
+ return /* @__PURE__ */ C("g", {
80
+ className: `fill-none transition-opacity ${i.ribbon}`,
81
+ onPointerEnter: () => {
82
+ e.onFocus({
83
+ flow: r,
84
+ node: null,
85
+ x: e.midX,
86
+ y: ((n.y0 ?? 0) + (n.y1 ?? 0)) / 2 - (n.width ?? 0) / 2 - 4
87
+ });
88
+ },
89
+ children: [/* @__PURE__ */ S("path", {
90
+ className: "draw stroke-l5",
91
+ d: t(n) ?? "",
92
+ pathLength: 1,
93
+ strokeWidth: Math.max(3, n.width ?? 1),
94
+ style: a(r, "mark")
95
+ }), /* @__PURE__ */ S("path", {
96
+ className: `draw transition-tone ${i.face}`,
97
+ d: t(n) ?? "",
98
+ pathLength: 1,
99
+ stroke: p(e.grainOf(n.from)),
100
+ strokeWidth: Math.max(1, (n.width ?? 1) - 2),
101
+ style: a(r, "mark")
102
+ })]
103
+ }, `${n.from}-${n.to}`);
104
+ }) });
105
+ }, R = (e) => e.lines.length === 1 ? /* @__PURE__ */ C(f, {
106
+ anchor: "end",
107
+ dy: "0.36em",
108
+ voice: "label",
109
+ x: e.x,
110
+ y: e.y,
111
+ children: [e.name, /* @__PURE__ */ C("tspan", {
112
+ className: "fill-muted",
113
+ children: [" · ", e.valueText]
114
+ })]
115
+ }) : /* @__PURE__ */ S(f, {
116
+ anchor: "end",
117
+ voice: "label",
118
+ y: e.y - (e.lines.length - 1) * A / 2,
119
+ children: e.lines.map((t, n) => /* @__PURE__ */ S("tspan", {
120
+ className: n === e.lines.length - 1 ? "fill-muted" : void 0,
121
+ dy: n === 0 ? "0.36em" : A,
122
+ x: e.x,
123
+ children: t
124
+ }, `${e.name}-${t}`))
125
+ }), z = (e) => {
126
+ let t = e.node.x0 ?? 0, n = e.node.x1 ?? 0, r = e.node.y0 ?? 0, i = e.node.y1 ?? 0, o = (r + i) / 2;
127
+ return /* @__PURE__ */ C(s, {
128
+ dim: !e.lit,
129
+ onPointerEnter: () => {
130
+ e.onEnter({
131
+ flow: null,
132
+ node: e.node.name,
133
+ x: (t + n) / 2,
134
+ y: r - 6
135
+ });
136
+ },
137
+ children: [/* @__PURE__ */ S("rect", {
138
+ className: `grow-y ${e.fill}`,
139
+ style: a(e.i, "mark"),
140
+ x: e.pattern === void 0 ? t : l(t),
141
+ y: e.pattern === void 0 ? r : l(r),
142
+ width: Math.round(n - t) - (e.pattern === void 0 ? 0 : 1),
143
+ height: Math.max(2, Math.round(i - r) - 1),
144
+ rx: 2,
145
+ fill: e.pattern,
146
+ strokeWidth: 1
147
+ }), e.node.side === "source" ? /* @__PURE__ */ S(R, {
148
+ lines: e.lines,
149
+ name: e.node.name,
150
+ valueText: e.valueText,
151
+ x: t - O,
152
+ y: o
153
+ }) : /* @__PURE__ */ C(f, {
154
+ dy: "0.36em",
155
+ voice: "label",
156
+ x: n + O,
157
+ y: o,
158
+ children: [e.node.name, /* @__PURE__ */ S("tspan", {
159
+ className: "t-value",
160
+ dx: 6,
161
+ children: e.valueText
162
+ })]
163
+ })]
164
+ });
165
+ }, B = ({ tex: e }) => /* @__PURE__ */ C("defs", { children: [
166
+ /* @__PURE__ */ S(h, {
167
+ id: e("cross"),
168
+ tone: "fill-l3"
169
+ }),
170
+ /* @__PURE__ */ S(g, {
171
+ angle: "falling",
172
+ id: e("falling"),
173
+ tone: "fill-l4"
174
+ }),
175
+ /* @__PURE__ */ S(g, {
176
+ id: e("rising"),
177
+ tone: "fill-l4"
178
+ }),
179
+ /* @__PURE__ */ S(v, {
180
+ id: e("dots"),
181
+ tone: "fill-l3"
182
+ }),
183
+ /* @__PURE__ */ S(_, {
184
+ id: e("rule"),
185
+ tone: "fill-l4"
186
+ })
187
+ ] }), V = (a) => {
188
+ let o = a.data ?? y, s = a.height ?? 420, l = a.format ?? E, f = a.unit ?? "MPs", [h, g] = x(null), _ = i(o.sources.map((e) => o.flows.filter((t) => t.from === e).reduce((e, t) => e + t.value, 0))), v = m("flow"), b = a.highlight ?? o.sources[_.indexOf(0)] ?? "", w = o.sources.filter((e) => e !== b), T = v("cross"), O = (e) => e === b ? T : v(D[w.indexOf(e) % D.length]), k = (e) => e.side === "target" ? "fill-l4" : e.name === b ? "fill-hero" : "stroke-l5", A = (e) => o.flows.filter((t) => t.from === e || t.to === e).reduce((e, t) => e + t.value, 0), j = `Flows from ${o.sources.join(", ")} into ${o.targets.join(", ")}`;
189
+ return /* @__PURE__ */ S(e, {
190
+ overlay: h === null ? null : /* @__PURE__ */ S(t, {
191
+ x: h.x,
192
+ y: h.y,
193
+ children: h.flow === null ? /* @__PURE__ */ S(c, {
194
+ facts: [`${l(A(h.node ?? ""))} ${f}`],
195
+ lead: h.node ?? ""
196
+ }) : /* @__PURE__ */ S(c, {
197
+ facts: [`${l(o.flows[h.flow].value)} ${f}`],
198
+ lead: `${o.flows[h.flow].from} → ${o.flows[h.flow].to}`
199
+ })
200
+ }),
201
+ children: (e) => {
202
+ let t = e < 480, i = 8 + r(n(a), e - 16, 32), c = M(o, e, t, (e) => l(A(e))), f = N(o, e, s, t, i, c);
203
+ return /* @__PURE__ */ C(d, {
204
+ height: s,
205
+ label: j,
206
+ leave: () => {
207
+ g(null);
208
+ },
209
+ width: e,
210
+ children: [
211
+ /* @__PURE__ */ S(B, { tex: v }),
212
+ /* @__PURE__ */ S(L, {
213
+ data: o,
214
+ focus: h,
215
+ graph: f,
216
+ grainOf: O,
217
+ heroGrain: T,
218
+ midX: e / 2,
219
+ onFocus: g
220
+ }),
221
+ f.nodes.map((e, t) => /* @__PURE__ */ S(z, {
222
+ fill: k(e),
223
+ pattern: e.side === "source" && e.name !== b ? p(O(e.name)) : void 0,
224
+ i: t,
225
+ lines: c.sourceLines.get(e.name) ?? [],
226
+ lit: I(h, o, e.name),
227
+ node: e,
228
+ onEnter: g,
229
+ valueText: l(e.value ?? 0)
230
+ }, e.id)),
231
+ /* @__PURE__ */ S(u, {
232
+ height: s,
233
+ text: n(a),
234
+ width: e
235
+ })
236
+ ]
237
+ });
238
+ }
239
+ });
240
+ };
241
+ //#endregion
242
+ export { V as AggregateSankey };
@@ -0,0 +1,122 @@
1
+ "use client";
2
+ //#region src/charts/glance/bar-race.data.ts
3
+ var e = {
4
+ periods: [
5
+ "2017-18",
6
+ "2018-19",
7
+ "2019-20",
8
+ "2020-21",
9
+ "2021-22",
10
+ "2022-23",
11
+ "2023-24",
12
+ "2024-25"
13
+ ],
14
+ series: [
15
+ {
16
+ label: "Waterloo",
17
+ values: [
18
+ 94.4,
19
+ 94.2,
20
+ 86.9,
21
+ 12.2,
22
+ 41.4,
23
+ 57.8,
24
+ 62.5,
25
+ 70.4
26
+ ]
27
+ },
28
+ {
29
+ label: "Victoria",
30
+ values: [
31
+ 75,
32
+ 74.7,
33
+ 73.6,
34
+ 13.8,
35
+ 36.8,
36
+ 45.6,
37
+ 50.8,
38
+ 53.8
39
+ ]
40
+ },
41
+ {
42
+ label: "Liverpool Street",
43
+ values: [
44
+ 67,
45
+ 69.5,
46
+ 66,
47
+ 11.2,
48
+ 32.2,
49
+ 80.4,
50
+ 94.5,
51
+ 98
52
+ ]
53
+ },
54
+ {
55
+ label: "London Bridge",
56
+ values: [
57
+ 48.5,
58
+ 61.3,
59
+ 63.1,
60
+ 13.8,
61
+ 33.3,
62
+ 47.7,
63
+ 50,
64
+ 54.7
65
+ ]
66
+ },
67
+ {
68
+ label: "Stratford",
69
+ values: [
70
+ 40.1,
71
+ 41.2,
72
+ 41.9,
73
+ 14,
74
+ 28.2,
75
+ 44.1,
76
+ 56.6,
77
+ 51.5
78
+ ]
79
+ },
80
+ {
81
+ label: "Paddington",
82
+ values: [
83
+ 36.6,
84
+ 38.2,
85
+ 44.9,
86
+ 6.4,
87
+ 23.9,
88
+ 59.2,
89
+ 66.9,
90
+ 69.9
91
+ ]
92
+ },
93
+ {
94
+ label: "Euston",
95
+ values: [
96
+ 44.7,
97
+ 46.1,
98
+ 44.8,
99
+ 6.6,
100
+ 23.1,
101
+ 31.3,
102
+ 36.2,
103
+ 40.2
104
+ ]
105
+ },
106
+ {
107
+ label: "Farringdon",
108
+ values: [
109
+ 12.6,
110
+ 15.1,
111
+ 16.5,
112
+ 2.6,
113
+ 6.9,
114
+ 31.5,
115
+ 46,
116
+ 50.2
117
+ ]
118
+ }
119
+ ]
120
+ };
121
+ //#endregion
122
+ export { e as barRaceDemo };