@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,46 @@
1
+ "use client";
2
+ import { noteOf as e } from "../util.js";
3
+ import { withoutRemoteIslets as t, withoutWrappedParts as n } from "./geo.js";
4
+ import { Choropleth as r } from "./choropleth.js";
5
+ import { worldChoroplethDemo as i, worldCountries as a } from "./world-choropleth.data.js";
6
+ import { useMemo as o } from "react";
7
+ import { jsx as s } from "react/jsx-runtime";
8
+ import { geoEqualEarth as c } from "d3-geo";
9
+ //#region src/charts/maps/world-choropleth.tsx
10
+ var l = [
11
+ 1,
12
+ 2,
13
+ 3,
14
+ 4
15
+ ], u = [
16
+ "Portugal",
17
+ "France",
18
+ "Italy",
19
+ "Australia",
20
+ "Argentina"
21
+ ], d = (e, t) => c().fitSize(e, t), f = (e) => Number.isInteger(e) ? String(e) : e.toFixed(1), p = (e) => e.toFixed(1), m = a.map((e) => t(n(e))), h = (t) => {
22
+ let n = t.data ?? i, a = t.format ?? p, c = o(() => n.map((e) => ({
23
+ dx: e.dx,
24
+ dy: e.dy,
25
+ key: e.country,
26
+ label: e.code,
27
+ value: e.value
28
+ })), [n]), h = t.highlight === void 0 ? u : [t.highlight].flat(), g = n.toSorted((e, t) => t.value - e.value).slice(0, 5).map((e) => `${e.code ?? e.country} ${a(e.value)}`);
29
+ return /* @__PURE__ */ s(r, {
30
+ ariaLabel: `World choropleth, highest: ${g.join(", ")}`,
31
+ aspect: .46,
32
+ data: c,
33
+ emptyLabel: t.emptyLabel ?? "No data",
34
+ format: a,
35
+ labels: h,
36
+ maxHeight: t.height ?? 480,
37
+ note: e(t),
38
+ project: d,
39
+ regions: m,
40
+ short: t.short ?? f,
41
+ thresholds: t.thresholds ?? l,
42
+ unit: t.unit
43
+ });
44
+ };
45
+ //#endregion
46
+ export { h as WorldChoropleth };
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { cx as e } from "./util.js";
3
+ import { crisp as t } from "./axes.js";
4
+ import { DOT as n, RING_WEIGHT as r } from "./marks.js";
5
+ import { barPath as i } from "./shapes.js";
6
+ import { jsx as a } from "react/jsx-runtime";
7
+ //#region src/charts/markers.tsx
8
+ var o = ({ size: e = "sm", ...t }) => /* @__PURE__ */ a("circle", {
9
+ r: n[e],
10
+ ...t
11
+ }), s = ({ className: e = "", open: t = !1, size: i = "sm", weight: o = "rest", ...s }) => {
12
+ let c = r[o];
13
+ return /* @__PURE__ */ a("circle", {
14
+ className: `${t ? "fill-none" : "fill-paper"} ${e}`,
15
+ r: n[i] - c / 2,
16
+ strokeWidth: c,
17
+ ...s
18
+ });
19
+ }, c = ({ className: n, dir: r, fill: o, h: s, outline: c = "stroke-l5", w: l, x: u, y: d, ...f }) => {
20
+ if (o === void 0) return /* @__PURE__ */ a("path", {
21
+ className: n,
22
+ d: i(u, d, l, s, r),
23
+ ...f
24
+ });
25
+ let p = r === "up" || r === "down", m = t(u), h = t(d);
26
+ return /* @__PURE__ */ a("path", {
27
+ className: e("shape-crisp", c, n),
28
+ d: i(m, h, p ? Math.round(l) - 1 : Math.round(u + l) - Math.round(u), p ? Math.round(d + s) - Math.round(d) : Math.round(s) - 1, r),
29
+ fill: o,
30
+ strokeWidth: 1,
31
+ ...f
32
+ });
33
+ };
34
+ //#endregion
35
+ export { c as Bar, o as Dot, s as Ring };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ //#region src/charts/marks.ts
3
+ var e = {
4
+ lg: 6,
5
+ md: 4.5,
6
+ sm: 3,
7
+ xs: 2
8
+ }, t = {
9
+ cursor: 1.5,
10
+ rest: 1
11
+ }, n = {
12
+ lg: 9,
13
+ md: 6,
14
+ sm: 4,
15
+ xl: 14
16
+ }, r = 2, i = {
17
+ hero: 2,
18
+ rest: 1
19
+ }, a = {
20
+ h: 2,
21
+ w: 6
22
+ }, o = {
23
+ guide: 4,
24
+ mark: 3
25
+ }, s = {
26
+ entryGap: 16,
27
+ gap: 6,
28
+ swatch: 12
29
+ };
30
+ //#endregion
31
+ export { e as DOT, s as KEY, a as LABEL_TICK, r as MARK_WEIGHT, o as RING_STEP, t as RING_WEIGHT, i as STEM, n as TICK };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ //#region src/charts/motion.ts
3
+ var e = (e) => e < .5 ? 8 * e ** 4 : 1 - (-2 * e + 2) ** 4 / 2, t = {
4
+ change: 400,
5
+ enter: 600,
6
+ grow: 800,
7
+ hover: 150,
8
+ long: 1200
9
+ };
10
+ //#endregion
11
+ export { t as DURATION, e as easeTravel };
@@ -0,0 +1,101 @@
1
+ "use client";
2
+ //#region src/charts/originals/daily-users.data.ts
3
+ var e = Date.UTC(1976, 5, 1), t = [
4
+ 15.9,
5
+ 16.3,
6
+ 16,
7
+ 18.9,
8
+ 19.8,
9
+ 23.5,
10
+ 24.6,
11
+ 28.4,
12
+ 26.9,
13
+ 19,
14
+ 19.8,
15
+ 19.8,
16
+ 22.7,
17
+ 21.6,
18
+ 21.6,
19
+ 15.4,
20
+ 17.6,
21
+ 20.1,
22
+ 14.1,
23
+ 18.1,
24
+ 20.8,
25
+ 24.1,
26
+ 26.2,
27
+ 25.8,
28
+ 29,
29
+ 29.3,
30
+ 29.8,
31
+ 30.3,
32
+ 30.1,
33
+ 29.7,
34
+ 30.4,
35
+ 31.8,
36
+ 33.1,
37
+ 31.3,
38
+ 31.3,
39
+ 31.6,
40
+ 30.4,
41
+ 29.5,
42
+ 23.5,
43
+ 23.4,
44
+ 27.3,
45
+ 26.3,
46
+ 21.8,
47
+ 21.9,
48
+ 23.1,
49
+ 21.7,
50
+ 22.7,
51
+ 24.4,
52
+ 21.6,
53
+ 18.4,
54
+ 19.6,
55
+ 20.5,
56
+ 19.7,
57
+ 20,
58
+ 21.3,
59
+ 21.1,
60
+ 23.4,
61
+ 20.5,
62
+ 22.8,
63
+ 19.3,
64
+ 17.2,
65
+ 19,
66
+ 19.3,
67
+ 20.2,
68
+ 20,
69
+ 20.7,
70
+ 21.4,
71
+ 21.8,
72
+ 22.9,
73
+ 23.2,
74
+ 24.3,
75
+ 25.2,
76
+ 25.7,
77
+ 25.2,
78
+ 24,
79
+ 25.3,
80
+ 25.9,
81
+ 26.4,
82
+ 24,
83
+ 25.2,
84
+ 27.2,
85
+ 24.9,
86
+ 26.6,
87
+ 27.2,
88
+ 28.9,
89
+ 28.8,
90
+ 26.7,
91
+ 20.6,
92
+ 19.4,
93
+ 21.4,
94
+ 17.7,
95
+ 19
96
+ ].map((t, n) => ({
97
+ date: new Date(e + n * 864e5),
98
+ value: t
99
+ }));
100
+ //#endregion
101
+ export { t as dailyUsers };
@@ -0,0 +1,203 @@
1
+ "use client";
2
+ import { fmtDegC as e, monthTickLabels as t } from "../../lib/format.js";
3
+ import { useScrub as n } from "../hooks.js";
4
+ import { Plot as r, Tooltip as i } from "../core.js";
5
+ import { cx as a, stagger as o, weeklyMean as s } from "../util.js";
6
+ import { TipText as c } from "../hover.js";
7
+ import { crisp as l } from "../axes.js";
8
+ import { Dot as u } from "../markers.js";
9
+ import { Stem as d } from "../rules.js";
10
+ import { ChartSvg as f } from "../svg.js";
11
+ import { Label as p } from "../text.js";
12
+ import { TEXTURE_PITCH as m, paint as h, useTextureIds as g } from "../texture-ids.js";
13
+ import { Hatch as _, KeySwatch as v, Stipple as y } from "../texture.js";
14
+ import { ValueGrid as b } from "../value-grid.js";
15
+ import { dailyUsers as x } from "./daily-users.data.js";
16
+ import { Key as S } from "./key.js";
17
+ import { scaleLinear as C } from "d3-scale";
18
+ import { utcFormat as w } from "d3-time-format";
19
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
20
+ import { area as O, curveMonotoneX as k, line as A } from "d3-shape";
21
+ //#region src/charts/originals/daily-users.tsx
22
+ var j = w("%a %-d %b"), M = (e) => {
23
+ let t = Math.abs(e).toFixed(1);
24
+ return `${e < 0 && t !== "0.0" ? "−" : "+"}${t} °C`;
25
+ }, N = (t) => e(t).replace(".0 °C", " °C"), P = (e, t) => e ? "stroke-ink" : t ? "stroke-l1" : "stroke-l4", F = ({ data: e, frame: t, hero: n, hover: r, mean: i }) => /* @__PURE__ */ E("g", { children: e.map((e, s) => {
26
+ let c = e.value >= i[s];
27
+ return /* @__PURE__ */ E(d, {
28
+ className: a("grow-y", "transition-tone", !c && "from-top", P(s === n, r === s)),
29
+ hero: s === n,
30
+ style: o(s, "dense"),
31
+ x: t.x(s),
32
+ y0: t.y(i[s]),
33
+ y1: t.y(e.value)
34
+ }, e.date.toISOString());
35
+ }) }), I = ({ frame: e, mean: t, tex: n, values: r }) => {
36
+ let i = O().x((t, n) => e.x(n)).y0((n, r) => e.y(t[r])).y1((t) => e.y(t)).curve(k)(r), a = (n) => O().x((t, n) => e.x(n)).y0((t) => e.y(t)).y1(n).curve(k)(t) ?? "";
37
+ return /* @__PURE__ */ D("g", {
38
+ className: "fade",
39
+ style: o(4),
40
+ children: [/* @__PURE__ */ D("defs", { children: [
41
+ /* @__PURE__ */ E(y, {
42
+ id: n("over"),
43
+ pitch: m.dense,
44
+ tone: "fill-l3"
45
+ }),
46
+ /* @__PURE__ */ E(_, {
47
+ angle: "falling",
48
+ id: n("under"),
49
+ pitch: m.hatch,
50
+ tone: "fill-l4"
51
+ }),
52
+ /* @__PURE__ */ E("clipPath", {
53
+ id: n("above"),
54
+ children: /* @__PURE__ */ E("path", { d: a(0) })
55
+ }),
56
+ /* @__PURE__ */ E("clipPath", {
57
+ id: n("below"),
58
+ children: /* @__PURE__ */ E("path", { d: a(e.floor + 40) })
59
+ })
60
+ ] }), ["above", "below"].map((e) => /* @__PURE__ */ E("path", {
61
+ className: "stroke-l5",
62
+ clipPath: h(n(e)),
63
+ d: i ?? "",
64
+ fill: h(n(e === "above" ? "over" : "under")),
65
+ strokeWidth: 1
66
+ }, e))]
67
+ });
68
+ }, L = ({ data: e, frame: n, width: r }) => {
69
+ let i = e.flatMap((e, t) => e.date.getUTCDate() === 1 ? [t] : []), a = t(i.map((t) => e[t].date));
70
+ return /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E(b, {
71
+ floor: n.floor,
72
+ ticks: n.y.ticks(r < 420 ? 3 : 4),
73
+ format: N,
74
+ side: "right",
75
+ x0: n.x0,
76
+ x1: r,
77
+ y: n.y
78
+ }), i.map((t, r) => /* @__PURE__ */ E(p, {
79
+ voice: "axis",
80
+ x: n.x(t),
81
+ y: n.floor + 22,
82
+ children: a[r]
83
+ }, e[t].date.toISOString()))] });
84
+ }, R = (e) => [
85
+ {
86
+ label: "Weekly mean",
87
+ mark: /* @__PURE__ */ E("line", {
88
+ className: "stroke-l2 cap-round",
89
+ strokeWidth: 1.5,
90
+ x1: 1,
91
+ x2: 11,
92
+ y1: 0,
93
+ y2: 0
94
+ })
95
+ },
96
+ {
97
+ label: "Above",
98
+ mark: /* @__PURE__ */ E(v, {
99
+ fill: h(e("over")),
100
+ x: 0,
101
+ y: -6
102
+ })
103
+ },
104
+ {
105
+ label: "Below",
106
+ mark: /* @__PURE__ */ E(v, {
107
+ fill: h(e("under")),
108
+ x: 0,
109
+ y: -6
110
+ })
111
+ }
112
+ ], z = {
113
+ bottom: 30,
114
+ left: 0,
115
+ right: 40,
116
+ top: 44
117
+ }, B = (e, t, n) => {
118
+ let r = e.map((e) => e.value), i = Math.min(...r), a = Math.max(...r), o = z.left, s = t - z.right, c = n - z.bottom, l = (s - o) / e.length;
119
+ return {
120
+ floor: c,
121
+ x: (e) => o + (e + .5) * l,
122
+ x0: o,
123
+ x1: s,
124
+ y: C().domain([i - (a - i) * .06, a]).range([c, z.top])
125
+ };
126
+ }, V = ({ data: t, height: n, scrub: r, width: a }) => {
127
+ let d = g("daily-users"), m = B(t, a, n), h = s(t.map((e) => e.value)), _ = t.map((e) => e.value), v = _.indexOf(Math.max(..._)), y = r.isHovering ? r.index : null, b = A().x((e, t) => m.x(t)).y((e) => m.y(e)).curve(k)(h) ?? "", x = `Daily maximum temperature, ${j(t[0].date)} to ${j(t.at(-1)?.date ?? t[0].date)}: hottest ${e(_[v])} on ${j(t[v].date)}`;
128
+ return /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ D(f, {
129
+ height: n,
130
+ label: x,
131
+ width: a,
132
+ ...r.bind(t.map((e, t) => m.x(t))),
133
+ children: [
134
+ /* @__PURE__ */ E(L, {
135
+ data: t,
136
+ frame: m,
137
+ width: a
138
+ }),
139
+ /* @__PURE__ */ E(I, {
140
+ frame: m,
141
+ mean: h,
142
+ tex: d,
143
+ values: _
144
+ }),
145
+ /* @__PURE__ */ E(F, {
146
+ data: t,
147
+ frame: m,
148
+ hero: v,
149
+ hover: y,
150
+ mean: h
151
+ }),
152
+ /* @__PURE__ */ E("path", {
153
+ className: "draw stroke-l2 cap-round fill-none",
154
+ d: b,
155
+ pathLength: 1,
156
+ strokeWidth: 1.5
157
+ }),
158
+ /* @__PURE__ */ E(u, {
159
+ className: "pop fill-hero",
160
+ cx: Math.round(m.x(v)),
161
+ cy: m.y(_[v]),
162
+ size: "md",
163
+ style: o(8)
164
+ }),
165
+ /* @__PURE__ */ E(p, {
166
+ anchor: "middle",
167
+ order: 8,
168
+ voice: "value",
169
+ x: m.x(v),
170
+ y: m.y(_[v]) - 10,
171
+ children: e(_[v])
172
+ }),
173
+ y === null || y === v ? null : /* @__PURE__ */ E(u, {
174
+ className: "fill-l2",
175
+ cx: l(m.x(y)),
176
+ cy: m.y(_[y]),
177
+ size: "sm"
178
+ }),
179
+ /* @__PURE__ */ E(S, {
180
+ items: R(d),
181
+ right: a,
182
+ y: 10
183
+ })
184
+ ]
185
+ }), y === null ? null : /* @__PURE__ */ E(i, {
186
+ x: m.x(y),
187
+ y: Math.min(m.y(_[y]), m.y(h[y])) - 6,
188
+ children: /* @__PURE__ */ E(c, {
189
+ facts: [e(_[y]), `${M(_[y] - h[y])} vs mean`],
190
+ lead: j(t[y].date)
191
+ })
192
+ })] });
193
+ }, H = (e) => {
194
+ let t = e.data ?? x, i = e.height ?? 460, a = n(0, t.map((e) => e.date));
195
+ return /* @__PURE__ */ E(r, { children: (e) => /* @__PURE__ */ E(V, {
196
+ data: t,
197
+ height: i,
198
+ scrub: a,
199
+ width: e
200
+ }) });
201
+ };
202
+ //#endregion
203
+ export { H as DailyUsers };
@@ -0,0 +1,92 @@
1
+ "use client";
2
+ //#region src/charts/originals/feature-rank.data.ts
3
+ var e = [
4
+ "1984",
5
+ "1994",
6
+ "2004",
7
+ "2014",
8
+ "2024"
9
+ ], t = [
10
+ {
11
+ feature: "Wheat",
12
+ weekly: [
13
+ 1939.3,
14
+ 1811.3,
15
+ 1989.8,
16
+ 1935.7,
17
+ 1530.8
18
+ ]
19
+ },
20
+ {
21
+ feature: "Barley",
22
+ weekly: [
23
+ 1979.7,
24
+ 1107.7,
25
+ 1007.4,
26
+ 1079.8,
27
+ 1193.9
28
+ ]
29
+ },
30
+ {
31
+ feature: "Oats",
32
+ weekly: [
33
+ 105.2,
34
+ 108.6,
35
+ 107.8,
36
+ 137.2,
37
+ 182
38
+ ]
39
+ },
40
+ {
41
+ feature: "Oilseed rape",
42
+ weekly: [
43
+ 268.6,
44
+ 404.4,
45
+ 498.4,
46
+ 674.6,
47
+ 293.2
48
+ ]
49
+ },
50
+ {
51
+ feature: "Potatoes",
52
+ weekly: [
53
+ 198.4,
54
+ 164.1,
55
+ 148.4,
56
+ 140.5,
57
+ 118.4
58
+ ]
59
+ },
60
+ {
61
+ feature: "Sugar beet",
62
+ weekly: [
63
+ 199.1,
64
+ 194.8,
65
+ 153.9,
66
+ 116.3,
67
+ 102.8
68
+ ]
69
+ },
70
+ {
71
+ feature: "Field beans",
72
+ weekly: [
73
+ 32.4,
74
+ 149.3,
75
+ 179.2,
76
+ 107.1,
77
+ 135.4
78
+ ]
79
+ },
80
+ {
81
+ feature: "Maize",
82
+ weekly: [
83
+ 15.5,
84
+ 94.2,
85
+ 117.6,
86
+ 183.5,
87
+ 266.4
88
+ ]
89
+ }
90
+ ];
91
+ //#endregion
92
+ export { e as QUARTERS, t as featureUse };
@@ -0,0 +1,167 @@
1
+ "use client";
2
+ import { Plot as e, Tooltip as t } from "../core.js";
3
+ import { clamp as n, ranks as r, sansWidth as i, stagger as a } from "../util.js";
4
+ import { DimGroup as o, TipText as s } from "../hover.js";
5
+ import { HRule as c, VRule as l } from "../rules.js";
6
+ import { ChartSvg as u } from "../svg.js";
7
+ import { Label as d } from "../text.js";
8
+ import { paint as f, useTextureIds as p } from "../texture-ids.js";
9
+ import { CrossHatch as m, Hatch as h } from "../texture.js";
10
+ import { QUARTERS as g, featureUse as _ } from "./feature-rank.data.js";
11
+ import { useState as v } from "react";
12
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
13
+ //#region src/charts/originals/feature-rank.tsx
14
+ var S = 40, C = 64, w = 20, T = 12, E = .3, D = 22, O = (e) => `${Math.round(e).toLocaleString("en-GB")}k`, k = [
15
+ "1st",
16
+ "2nd",
17
+ "3rd"
18
+ ], A = (e) => k.at(e) ?? `${e + 1}th`, j = (e, t) => {
19
+ let n = Math.max(...e.map((e) => i(e.feature, 12))), r = Math.max(...e.map((e) => i(O(e.weekly.at(-1) ?? 0), 12))), a = Math.max(...e.flatMap((e) => e.weekly)), o = w, s = t - (T + n + T + r), c = (s - o) / g.length;
20
+ return {
21
+ cx: (e) => o + (e + .5) * c,
22
+ half: c * E,
23
+ thick: (e) => Math.max(2, Math.round(D / 2 * e / a)),
24
+ x0: o,
25
+ x1: s,
26
+ y: (e) => Math.round(S + e * C)
27
+ };
28
+ }, M = (e, t) => e.map((n, r) => ({
29
+ a: Math.round(t.cx(r) - t.half),
30
+ b: r === e.length - 1 ? Math.round(t.x1) : Math.round(t.cx(r) + t.half),
31
+ y: t.y(n)
32
+ })), N = (e, t, n, r) => {
33
+ let i = M(e, n).map((e, i) => ({
34
+ ...e,
35
+ e: e.y + r * (n.thick(t[i]) - .5)
36
+ }));
37
+ return i.flatMap((e, t) => {
38
+ let n = i.at(t + 1), r = [`${e.a},${e.e}`, `${e.b},${e.e}`];
39
+ if (n === void 0 || n.y !== e.y || n.e === e.e) return r;
40
+ let a = Math.round((e.b + n.a) / 2);
41
+ return [
42
+ ...r,
43
+ `${a},${e.e}`,
44
+ `${a},${n.e}`
45
+ ];
46
+ });
47
+ }, P = (e, t, n) => {
48
+ let r = N(e, t, n, -1), i = N(e, t, n, 1).toReversed();
49
+ return `M${[...r, ...i].join(" L")}Z`;
50
+ }, F = ({ datum: e, dim: t, hero: n, i: r, lay: i, rank: s, tex: c, width: l }) => {
51
+ let u = s.at(-1) ?? 0, p = i.y(u);
52
+ return /* @__PURE__ */ x(o, {
53
+ dim: t,
54
+ children: [
55
+ /* @__PURE__ */ b("path", {
56
+ className: `grow-x ${n ? "stroke-ink" : "stroke-l5"}`,
57
+ d: P(s, e.weekly, i),
58
+ fill: f(c(n ? "hero" : "band")),
59
+ strokeLinejoin: "miter",
60
+ strokeWidth: 1,
61
+ style: a(r, "series")
62
+ }),
63
+ /* @__PURE__ */ b(d, {
64
+ middle: !0,
65
+ muted: !n,
66
+ order: r + 8,
67
+ voice: "label",
68
+ x: i.x1 + T,
69
+ y: p,
70
+ children: e.feature
71
+ }),
72
+ /* @__PURE__ */ b(d, {
73
+ anchor: "end",
74
+ middle: !0,
75
+ muted: !n,
76
+ order: r + 8,
77
+ voice: "value",
78
+ x: l,
79
+ y: p,
80
+ children: O(e.weekly.at(-1) ?? 0)
81
+ })
82
+ ]
83
+ });
84
+ }, I = ({ count: e, lay: t }) => /* @__PURE__ */ x("g", { children: [
85
+ g.slice(1).map((n, r) => /* @__PURE__ */ b(l, {
86
+ kind: "grid",
87
+ x: (t.cx(r) + t.cx(r + 1)) / 2,
88
+ y0: t.y(0) - 14,
89
+ y1: t.y(e - 1) + 14
90
+ }, n)),
91
+ g.map((e, n) => /* @__PURE__ */ b(d, {
92
+ anchor: "middle",
93
+ voice: "axis",
94
+ x: t.cx(n),
95
+ y: 14,
96
+ children: e
97
+ }, e)),
98
+ Array.from({ length: e }, (e, n) => /* @__PURE__ */ x("g", { children: [/* @__PURE__ */ b(c, {
99
+ kind: "grid",
100
+ x0: Math.round(t.x0),
101
+ x1: t.x1,
102
+ y: t.y(n)
103
+ }), /* @__PURE__ */ b(d, {
104
+ middle: !0,
105
+ voice: "axis",
106
+ x: 0,
107
+ y: t.y(n),
108
+ children: n + 1
109
+ })] }, `rank-${n + 1}`))
110
+ ] }), L = (i) => {
111
+ let a = i.data ?? _, [o, c] = v(null), l = p("feature-rank"), d = g.map((e, t) => r(a.map((e) => e.weekly[t]))), f = a.map((e, t) => d.map((e) => e[t])), w = f.findIndex((e) => e.at(-1) === 0), T = S + (a.length - 1) * C + 20, E = [...[...a.keys()].filter((e) => e !== w), w], D = `Arable crops ranked by area in the United Kingdom, ${g[0]} to ${g.at(-1) ?? ""}: ${a[w].feature} leads with ${O(a[w].weekly.at(-1) ?? 0)}`;
112
+ return /* @__PURE__ */ b(e, { children: (e) => {
113
+ let r = j(a, e), i = (r.x1 - r.x0) / g.length;
114
+ return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x(u, {
115
+ className: "touch-pan-y",
116
+ height: T,
117
+ label: D,
118
+ leave: () => {
119
+ c(null);
120
+ },
121
+ onPointerMove: (e) => {
122
+ let t = e.currentTarget.getBoundingClientRect(), o = n(Math.floor((e.clientX - t.left - r.x0) / i), 0, g.length - 1), s = n(Math.round((e.clientY - t.top - S) / C), 0, a.length - 1);
123
+ c({
124
+ f: d[o].indexOf(s),
125
+ q: o
126
+ });
127
+ },
128
+ width: e,
129
+ children: [
130
+ /* @__PURE__ */ x("defs", { children: [/* @__PURE__ */ b(h, {
131
+ id: l("band"),
132
+ tone: "fill-l4"
133
+ }), /* @__PURE__ */ b(m, {
134
+ id: l("hero"),
135
+ tone: "fill-hero"
136
+ })] }),
137
+ /* @__PURE__ */ b(I, {
138
+ count: a.length,
139
+ lay: r
140
+ }),
141
+ E.map((t) => /* @__PURE__ */ b(F, {
142
+ datum: a[t],
143
+ dim: o !== null && o.f !== t,
144
+ hero: t === w,
145
+ i: t,
146
+ lay: r,
147
+ rank: f[t],
148
+ tex: l,
149
+ width: e
150
+ }, a[t].feature))
151
+ ]
152
+ }), o === null ? null : /* @__PURE__ */ b(t, {
153
+ x: r.cx(o.q),
154
+ y: r.y(f[o.f][o.q]) - 6,
155
+ children: /* @__PURE__ */ b(s, {
156
+ facts: [
157
+ g[o.q],
158
+ A(f[o.f][o.q]),
159
+ O(a[o.f].weekly[o.q])
160
+ ],
161
+ lead: a[o.f].feature
162
+ })
163
+ })] });
164
+ } });
165
+ };
166
+ //#endregion
167
+ export { L as FeatureRank };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ //#region src/charts/originals/format.ts
3
+ var e = (e) => `${Number(e.toFixed(1))}%`;
4
+ //#endregion
5
+ export { e as fmtPercent };