@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel Howells
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,149 @@
1
- # Temporary Holding Version
1
+ # Hairline
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An engraved chart library for React. Ninety charts, one hand: pixel-snapped hairlines, a single ink hero per chart, and texture made the way a banknote is made, with crosshatch, hatching, stipple and halftone screens laid on exact pixels over warm paper.
4
+
5
+ See it at [hairline.danielhowells.com](https://hairline.danielhowells.com).
6
+
7
+ The temperament is an old-fashioned broadsheet chart desk with modern tools: authority from hierarchy rather than ornament, the zero line sharply distinct from a faint grid, labels set on the marks, exact figures, and every chart in the same frame.
8
+
9
+ ## Running it
10
+
11
+ ```sh
12
+ pnpm install
13
+ pnpm dev # http://localhost:5173
14
+ pnpm build
15
+ pnpm lint # @howells/lint (oxlint + oxfmt), kept at zero findings
16
+ pnpm lint:fix
17
+ pnpm build:lib # the package, into lib/
18
+ pnpm test # builds lib/, then tests it the way a consumer imports it
19
+ pnpm e2e # the acceptance suite in the Playwright image (acceptance/README.md)
20
+ ```
21
+
22
+ The docs site is its own workspace package in `site/`, built with [Blume](https://github.com/haydenbleasel/blume). Both commands build `lib/` first, since the site draws its examples with the package:
23
+
24
+ ```sh
25
+ pnpm --filter @howells/hairline-site dev # http://localhost:4321
26
+ pnpm --filter @howells/hairline-site build # static HTML in site/dist
27
+ ```
28
+
29
+ | Route | What |
30
+ | --- | --- |
31
+ | `#/` | The grid: every chart, each in the house frame, with nothing else |
32
+ | `#/chart/<ID>` | One chart on its own, for example `#/chart/L13` |
33
+ | `#/kit` | The fills, marks and type the charts are drawn from |
34
+ | `#/sources` | Where each chart's numbers come from |
35
+
36
+ Three modes, Pink (the default, after the salmon broadsheet), Paper and Dark, set the same ink on three papers. The switcher recolours everything with a cross-fade and is remembered between visits.
37
+
38
+ ## Docs
39
+
40
+ How to use the package lives on the docs site in [`site/`](site): getting started, the payload contract, the philosophy, and a page per chart. The chart pages are generated from the registry and the zod schemas (`site/src/chart-pages.ts`), so a chart's props table and JSON Schema cannot drift from what it validates. The site's `llms.txt` lists every registry kind with its JSON Schema, for agents.
41
+
42
+ ## Using it in an app
43
+
44
+ `@howells/hairline` is MIT licensed and not yet published to npm. Once it is, the install will be `npm install @howells/hairline`. Until then, build it locally. Clone the repository, then:
45
+
46
+ ```sh
47
+ pnpm install
48
+ pnpm build:lib # writes lib/
49
+ ```
50
+
51
+ and install it into the app from a path (`"@howells/hairline": "file:../hairline"`). A `file:` install is a copy, so rebuild and reinstall after any change. The host needs React 19.
52
+
53
+ Every packaged chart is also its own subpath (`@howells/hairline/rung-bars`, `/hairline-line`, `/hairline-area`, `/dumbbell-queue`, `/plumb-scatter`, `/slope`), so a bundle takes only what it draws. The map charts are behind `@howells/hairline/maps`.
54
+
55
+ ```tsx
56
+ import "@howells/hairline/hairline.css";
57
+ import { RungBars } from "@howells/hairline/rung-bars";
58
+
59
+ <div className="hl-root">
60
+ <RungBars
61
+ data={[
62
+ { label: "Everest", value: 8849 },
63
+ { label: "K2", value: 8611 },
64
+ { label: "Kangchenjunga", value: 8586 },
65
+ ]}
66
+ unit={500}
67
+ unitNote="One rung = 500 m"
68
+ />
69
+ </div>;
70
+ ```
71
+
72
+ `hairline.css` is precompiled: the tokens, text roles, rules, textures and motion in one file, with no Tailwind in the host. Its selectors sit under `.hl-root` and its custom properties are prefixed `--hl-`, so nothing meets the host's own. A host that builds with Tailwind v4 can instead import `@howells/hairline/tokens.css` and `@howells/hairline/theme.css` after `@import "tailwindcss"`.
73
+
74
+ - **Theming.** `deriveTheme` from `@howells/hairline/theme` is React-free. Give it a paper and an ink, and if you like a hero, an alert, a font and a mode, and it returns every `--hl-*` property the charts draw with, ready as a `style` on the `hl-root` element. The ramp is derived, not inverted, so dark mode keeps its contrast. Setting the `--hl-*` variables yourself works too. The library sets nothing on `:root`.
75
+
76
+ ```tsx
77
+ import { deriveTheme } from "@howells/hairline/theme";
78
+
79
+ const theme = deriveTheme({
80
+ paper: "#faf9f6",
81
+ ink: "#1d1d1b",
82
+ hero: "#a3402b",
83
+ });
84
+
85
+ <div className="hl-root" style={theme}>
86
+ {/* charts */}
87
+ </div>;
88
+ ```
89
+
90
+ - **Data is required.** The package never falls back to demo data. The six charts with schemas take a `data` (or, for `Slope`, `rows`) prop that a zod 4 schema validates; see the chart's page on the docs site.
91
+ - **The schema contract.** `@howells/hairline/schema` is React-free: one schema per chart, the types inferred from it, `validate` returning path-specific issues, formatter descriptors (`"percent"`, or Intl number-format options; functions still work from TypeScript), and a `registry` of each chart's `kind`, Visual Vocabulary job, data shape, limits and guidance. The JSON Schemas are emitted at build to `lib/json-schema/<kind>.json` (`@howells/hairline/json-schema/<kind>.json`), with an `index.json`.
92
+ - **Server mode.** Pass `width` and `height` for a fixed-size chart that is complete in the server's first HTML (`renderToString` returns the drawn chart), and it is drawn and ready (`data-hl-ready="true"`) with no client: a fixed-size chart defaults to `animate="off"`, while `animate="scroll"` or `"mount"` asks for the entry animation (then it starts hidden). The responsive chart defaults to `"scroll"`. Omit `width` for the measured, responsive chart, and give it `initialWidth` so its first render is real. A summary and a data table are in the markup for screen readers; `table` shows the table to everyone. Every module starts with `"use client"`, so a server component can render a chart whose props are plain data. A formatter function cannot cross that boundary, so use a descriptor, or wrap the chart in a client component of your own.
93
+ - **Export mode.** For slides and rendered images, draw at the logical `width` and set `scale` to show the whole composition larger through the viewBox, type and textures with it. `fit` fills the container at the chart's aspect ratio. `strokes="device"` keeps every stroke at one device pixel however large the chart is shown. It acts on stroked geometry only (rules, lines, rings, outlines); filled marks such as RungBars' bars scale with the composition either way, so there it changes just the baseline rule. `animate="off"` and `onReady` tell a renderer when the chart has settled.
94
+ - **Several roots on one page.** `idPrefix` leads every SVG id, so charts rendered in separate React roots do not collide.
95
+ - **Fonts.** `deriveTheme`'s `font`, or `--hl-font`, sets the charts' face. Label widths are measured for Inter, so another face may crowd; pass `metrics` with its glyph widths.
96
+ - **Emphasis.** The hero is chosen by a datum's key (`id`, else its label or date), never by index.
97
+ - **Size.** One chart costs a host, minified and gzipped with React left out and every other dependency bundled: DumbbellQueue 52 KB, HairlineArea 55 KB, HairlineLine 55 KB, PlumbScatter 52 KB, RungBars 47 KB, Slope 51 KB (1 KB = 1,000 bytes). `tests/bundle-size.test.ts` bundles each subpath and fails a chart that outgrows its budget; raising one is a reviewed edit to the test and to this line.
98
+ - **Types.** Each packaged chart exports its props and datum types by name (`RungBarsProps`, `RungDatum`); for the rest use `ComponentProps<typeof Chart>`.
99
+ - **The kit.** `@howells/hairline/kit` exports the parts the charts are drawn from (`Plot`, `ChartSvg`, `Label`, the rules, marks and textures), for a new chart drawn in the same hand.
100
+ - **The frame.** Charts draw only the plot and take no title or source. The host composes those, or sets `Frame` from `@howells/hairline/frame` round any chart: `<Frame name source footnote note>` is the gallery cell (the name, an (i) opening `note`, the chart, then the source and footnote). The in-plot unit key is the chart's `unitNote` prop; `note` is its deprecated old name.
101
+
102
+ ## The system
103
+
104
+ - **Type.** Inter only, in sentence case, with tabular figures wherever numbers line up. Three sizes and five roles: `t-axis`, `t-label`, `t-value` and `t-figure` in the charts, `text-small` around them. No capitals, no tracking, no mono; a lint rule holds the case.
105
+ - **Line.** Three stroke widths: 1px hairlines (snapped to the pixel grid with `crisp()` and `shape-crisp`), 1.5px for data lines and curves, 2px for emphasis. A ladder of rules: `grid-line` (faint), `rule` (quiet structure: leaders, tracks, connectors), `hairline` (baselines and zero lines, full ink).
106
+ - **Texture.** One shared module, `src/charts/texture.tsx`: `Hatch`, `CrossHatch`, `Rules`, `Stipple`, `DotScreen`, `Beads`, `DottedLine`, `DotRing`, `DottedPath`, `PixelLine` and `KeySwatch`. Pitches are named in `TEXTURE_PITCH` (hatch 4, crosshatch 6, dot screen 4, dense 3); diagonals are drawn as 1px pixel staircases, so they stay crisp. Textures sit on paper inside a 1px rule, and density or angle encodes a value.
107
+ - **Fills.** Every fill comes from one taxonomy, `src/charts/fills.ts`: a family (solid, hatch, crosshatch, rules, upright rules, stipple, dense stipple, broken rungs) in a tone (ink, strong, mid, quiet, faint, alert), or a step on one of two value ladders (halftone, hatch density) when the fill encodes a quantity. The Fills sheet on the Kit page (`#/kit`, beside Marks and Type) draws the whole taxonomy, so drift shows at a glance.
108
+ - **Colour.** Each mode is a set of CSS variables (`src/system/tokens.css`): paper, ink, an even warm ramp `--hl-l0`…`--hl-l6` drawn in OKLCH between them, `--hl-hero` for the one emphasised element, and `--hl-alert` for a single exceptional mark. Charts never use hex. Paper is built on patternmode's paper and ink; Pink is a greyed broadsheet rose; Dark rebuilds contrast on a warm near-black rather than inverting.
109
+ - **Grain.** Every surface carries a very faint noise in its own ink's colour (`--grain`), behind the marks and never over them, so the page feels like paper while ink and hairlines stay crisp.
110
+ - **Motion.** One set of tokens (`--ease-enter`, `--ease-travel`, five durations, four stagger tiers) shared by CSS and by the script-driven charts (`src/charts/motion.ts`). Charts reveal once as they scroll into view; under reduced motion nothing travels or fades, and the stylesheet draws the plot in the first paint (`data-hl-ready` turns "true" once hydration has read the preference).
111
+ - **Frame.** Every cell carries a short ink bar and the chart's name above the chart. Nothing else: no prose inside charts.
112
+ - **Data.** The gallery draws real public data, credited on `#/sources` and behind each chart's (i). A chart takes its data through props; the package carries none.
113
+
114
+ ## Layout
115
+
116
+ ```
117
+ src/
118
+ system/ tokens.css (modes, grain, motion), hairline.css (what the charts need: text roles, rules, motion utilities), app.css (the site's own theme), palette, router
119
+ index.ts every chart, generated by scripts/library-index.ts; kit.ts, the parts
120
+ charts/
121
+ core.tsx Plot, Chart, Tooltip, grids and ticks
122
+ texture.tsx engraved patterns and guides; texture-ids.ts for pitches and ids
123
+ control.tsx the one pill control (Play, Pause, Replay, view pickers)
124
+ motion.ts motion tokens for script-driven charts
125
+ hooks.ts useMeasure, useReveal, useSvgId, useScrub, useReducedMotion
126
+ axes.ts tick helpers and crisp()
127
+ lupi/ basics/ glance/ big/ maps/ board/ originals/ forms/ one kebab-case file per chart + <chart>.data.ts
128
+ schema/ one zod schema per packaged chart, and the registry (React-free)
129
+ gallery/ the registry of every chart (GalleryEntry)
130
+ pages/ the grid and the single-chart page
131
+ docs/
132
+ REFINE.md the design rules (the amendments are the current word)
133
+ BRIEF.md the original build brief and the reference mapping
134
+ site/ the docs site (Blume): hand-written pages in docs/, a page per chart from src/chart-pages.ts
135
+ reference/ (local only, git-ignored) the screenshots the first versions were rebuilt from
136
+ reports/ and research_notes/ research on broadsheet chart craft, with public-domain example plates
137
+ ```
138
+
139
+ ## Adding a chart
140
+
141
+ 1. Create `src/charts/<family>/<name>.tsx`. Render only the plot, inside `<Plot>`; the grid supplies the frame and the name.
142
+ 2. Take data through props, required; never default to demo data. Use the text roles, the rule ladder, the shared textures and theme colours only.
143
+ 3. Register it as a `GalleryEntry` with a plain, sentence-case name, and add its numbers to `src/gallery/sources.json` and `about.json`. Pick every fill from the Fills sheet; if a chart needs one that isn't there, add it to `fills.ts` so the sheet shows it.
144
+ 4. To package it, add `src/schema/<kind>.ts` following `rung-bars.ts`, an entry in `src/schema/registry.ts`, and an example in `site/src/examples.ts`. The chart's docs page, its JSON Schema and its line in the site's `llms.txt` follow from those.
145
+ 5. `pnpm typecheck`, `pnpm lint` and `pnpm test` must be clean, and the chart must be looked at in the browser at 1440 and 390.
146
+
147
+ ## Provenance
148
+
149
+ The first versions were rebuilt from two references: a set of dashboard charts shared publicly by @wheresryan22, and screenshots of the [Lieflat Charts](https://github.com/larashero3-dotcom/lieflat-charts) catalogue. Lieflat Charts is published under the PolyForm Noncommercial licence; none of its code was ever read or used here, and every chart has since been redesigned, renamed and given its own data. Ten charts (O1–O10) are original to Hairline.
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ //#region src/charts/axes.ts
3
+ var e = (e, t) => e < t ? "past" : e === t ? "active" : "future", t = (e) => Math.round(e) + .5;
4
+ //#endregion
5
+ export { t as crisp, e as phase };
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { rnd as e } from "../../lib/random.js";
3
+ import { dayAfter as t } from "./util-a.js";
4
+ //#region src/charts/basics/candlestick.data.ts
5
+ var n = [
6
+ [15.2, 15.6],
7
+ [15.6, 15.3],
8
+ [15.3, 15.9],
9
+ [15.9, 16.4],
10
+ [16.4, 16.2],
11
+ [16.2, 16.8],
12
+ [16.8, 17.3],
13
+ [17.3, 17.1],
14
+ [17.1, 17.8],
15
+ [17.8, 18.4],
16
+ [18.4, 18.9],
17
+ [18.9, 19.6],
18
+ [19.4, 17.2],
19
+ [17, 16.1],
20
+ [16.1, 15.4],
21
+ [15.4, 14.8],
22
+ [14.8, 15.1],
23
+ [15.1, 14.6],
24
+ [14.6, 15.3],
25
+ [15.3, 15.9],
26
+ [15.9, 16.7],
27
+ [16.7, 17.4],
28
+ [17.4, 17.2],
29
+ [17.2, 18.1],
30
+ [18.1, 18.6],
31
+ [18.6, 19.3],
32
+ [19.3, 19],
33
+ [19, 19.8],
34
+ [19.8, 20.4],
35
+ [20.4, 21.1]
36
+ ], r = (e) => Math.round(e * 10) / 10, i = n.map(([n = 0, i = 0], a) => ({
37
+ close: i,
38
+ date: t("2026-08-24", a + Math.floor(a / 5) * 2),
39
+ high: r(Math.max(n, i) + .2 + e(a, 1) * .8),
40
+ low: r(Math.min(n, i) - .2 - e(a, 2) * .8),
41
+ open: n
42
+ }));
43
+ //#endregion
44
+ export { i as candlestickDemo };
@@ -0,0 +1,180 @@
1
+ "use client";
2
+ import { dayTickLabels as e, fmtDay as t, fmtMoney as n, fmtPrice as r } from "../../lib/format.js";
3
+ import { useHover as i } from "../hooks.js";
4
+ import { Plot as a, Tooltip as o } from "../core.js";
5
+ import { noteOf as s, stagger as c } from "../util.js";
6
+ import { DimGroup as l, HitRect as u } from "../hover.js";
7
+ import "../marks.js";
8
+ import { FootNote as d } from "../plot-note.js";
9
+ import { HRule as f, Stem as p, Tick as m } from "../rules.js";
10
+ import { ChartSvg as h } from "../svg.js";
11
+ import { Label as g } from "../text.js";
12
+ import { inkWidth as _ } from "./util-b.js";
13
+ import { paint as v, useTextureIds as y } from "../texture-ids.js";
14
+ import { Hatch as b } from "../texture.js";
15
+ import { ValueGrid as x } from "../value-grid.js";
16
+ import { candlestickDemo as S } from "./candlestick.data.js";
17
+ import { scaleBand as C, scaleLinear as w } from "d3-scale";
18
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
19
+ //#region src/charts/basics/candlestick.tsx
20
+ var D = (e) => e.date.toISOString(), O = (e, t) => {
21
+ let n = e.filter((e) => e.date.getUTCDay() === 1);
22
+ return t ? n.filter((e, t) => t % 2 == 0) : n;
23
+ }, k = (t, n, r, i, a, o) => {
24
+ let s = (e) => C().domain(r.map(D)).range([0, e - 48]).paddingInner(.1).paddingOuter(.4), c = (t) => {
25
+ let n = s(t), i = n.bandwidth(), a = O(r, i < 12), c = e(a.map((e) => e.date)), l = [...a.map((e, t) => ({
26
+ d: e,
27
+ text: c[t] ?? ""
28
+ })), ...o];
29
+ return Math.max(0, ...l.map((e) => Math.ceil(_(e.text)) / 2 - ((n(D(e.d)) ?? 0) + i / 2)));
30
+ }, l = r.length * 26 + 48, u = Math.min(t - 4, l);
31
+ for (let e = 0; e < 3; e += 1) u = Math.min(t - 4 - c(u), l);
32
+ let d = c(u), f = Math.round((t - u - d) / 2 + d), p = f + u, m = Math.round(n - (a ? 78 : 32)), h = s(u).range([f, p - 48]), g = h.bandwidth();
33
+ return {
34
+ axisY: m,
35
+ body: Math.max(3, Math.min(14, g * .62)),
36
+ left: f,
37
+ narrow: g < 12,
38
+ right: p,
39
+ x: h,
40
+ y: w().domain(i).range([m - 28, 30])
41
+ };
42
+ }, A = (e, t) => (e.x(D(t)) ?? 0) + e.x.bandwidth() / 2, j = (t) => {
43
+ let { layout: n } = t, r = O(t.data, n.narrow), i = e(r.map((e) => e.date));
44
+ return /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T(f, {
45
+ x0: n.left,
46
+ x1: n.right,
47
+ y: n.axisY
48
+ }), r.map((e, t) => /* @__PURE__ */ E("g", { children: [/* @__PURE__ */ T(m, {
49
+ x: A(n, e),
50
+ y: n.axisY + 1
51
+ }), /* @__PURE__ */ T(g, {
52
+ anchor: "middle",
53
+ voice: "axis",
54
+ x: A(n, e),
55
+ y: n.axisY + 20,
56
+ children: i[t]
57
+ })] }, D(e)))] });
58
+ }, M = (e) => e ? 2 : 1, N = (e) => {
59
+ let { datum: t, layout: n } = e, { y: r } = n, i = A(n, t), a = n.x.bandwidth(), o = t.close >= t.open, s = 2 * Math.floor(n.body / 2) + 1, d = Math.round(i) - Math.floor(s / 2), f = Math.round(r(Math.max(t.open, t.close))), m = Math.max(3, Math.round(r(Math.min(t.open, t.close))) - f), h = !o && !e.hero, g = o ? M(e.hero) : Number(h), _ = e.hero ? "fill-hero" : "stroke-l5", y = e.hero ? "fill-paper stroke-hero" : "fill-paper stroke-l3";
60
+ return /* @__PURE__ */ E(l, {
61
+ dim: e.dim,
62
+ onPointerEnter: () => {
63
+ e.onHover(i, r(t.high) - 8);
64
+ },
65
+ children: [
66
+ /* @__PURE__ */ T(u, {
67
+ height: r(t.low) - r(t.high) + 12,
68
+ width: a + 2,
69
+ x: i - a / 2 - 1,
70
+ y: r(t.high) - 6
71
+ }),
72
+ /* @__PURE__ */ T(p, {
73
+ className: `fade ${e.hero ? "stroke-hero" : "stroke-l3"}`,
74
+ style: c(e.index, "mark"),
75
+ x: i,
76
+ y0: Math.round(r(t.high)),
77
+ y1: Math.round(r(t.low))
78
+ }),
79
+ /* @__PURE__ */ T("rect", {
80
+ className: `grow-y ${o ? y : _}`,
81
+ fill: h ? v(e.hatch) : void 0,
82
+ height: m - g,
83
+ rx: 2 - g / 2,
84
+ strokeWidth: g,
85
+ style: c(e.index, "mark"),
86
+ width: s - g,
87
+ x: d + g / 2,
88
+ y: f + g / 2
89
+ })
90
+ ]
91
+ });
92
+ }, P = (e) => {
93
+ let c = e.data ?? S, l = e.height ?? 420, u = e.format ?? n, f = e.formatPrice ?? r, p = i(), m = y("candle"), _ = Math.min(...c.map((e) => e.low)), v = Math.max(...c.map((e) => e.high)), C = c.find((e) => e.high === v), O = c.find((e) => e.low === _), M = w().domain([_, v]).nice(5), [P = _, F = v] = M.domain(), I = M.ticks(5), L = `Daily prices, ${c.length} days, from ${f(c[0]?.open ?? 0)} to ${f(c.at(-1)?.close ?? 0)}; high ${f(v)}, low ${f(_)}`;
94
+ return /* @__PURE__ */ T(a, {
95
+ overlay: p.at === null ? null : /* @__PURE__ */ E(o, {
96
+ x: p.at.x,
97
+ y: p.at.y,
98
+ children: [
99
+ /* @__PURE__ */ T("b", { children: t(c[p.at.key].date) }),
100
+ " · O",
101
+ " ",
102
+ f(c[p.at.key].open),
103
+ " · H",
104
+ " ",
105
+ f(c[p.at.key].high),
106
+ " · L",
107
+ " ",
108
+ f(c[p.at.key].low),
109
+ " · C",
110
+ " ",
111
+ f(c[p.at.key].close)
112
+ ]
113
+ }),
114
+ children: (t) => {
115
+ let n = k(t, l, c, [P, F], s(e) !== void 0, [C, O].flatMap((e, t) => e === void 0 ? [] : [{
116
+ d: e,
117
+ text: f(t === 0 ? v : _)
118
+ }]));
119
+ return /* @__PURE__ */ E(h, {
120
+ height: l,
121
+ label: L,
122
+ leave: p.clear,
123
+ width: t,
124
+ children: [
125
+ /* @__PURE__ */ T("defs", { children: /* @__PURE__ */ T(b, {
126
+ id: m("hatch"),
127
+ tone: "fill-l3"
128
+ }) }),
129
+ /* @__PURE__ */ T(x, {
130
+ labelFloor: !0,
131
+ side: "right",
132
+ floor: n.axisY,
133
+ format: u,
134
+ ticks: I,
135
+ x0: n.left,
136
+ x1: n.right,
137
+ y: n.y
138
+ }),
139
+ /* @__PURE__ */ T(j, {
140
+ data: c,
141
+ layout: n
142
+ }),
143
+ c.map((e, t) => /* @__PURE__ */ T(N, {
144
+ hatch: m("hatch"),
145
+ datum: e,
146
+ hero: t === c.length - 1,
147
+ dim: p.dim(t),
148
+ index: t,
149
+ layout: n,
150
+ onHover: p.showAt(t)
151
+ }, D(e))),
152
+ C === void 0 ? null : /* @__PURE__ */ T(g, {
153
+ anchor: "middle",
154
+ order: 10,
155
+ voice: "axis",
156
+ x: A(n, C),
157
+ y: n.y(v) - 10,
158
+ children: f(v)
159
+ }),
160
+ O === void 0 ? null : /* @__PURE__ */ T(g, {
161
+ anchor: "middle",
162
+ halo: !0,
163
+ order: 10,
164
+ voice: "axis",
165
+ x: A(n, O),
166
+ y: n.y(_) + 18,
167
+ children: f(_)
168
+ }),
169
+ /* @__PURE__ */ T(d, {
170
+ height: l,
171
+ text: s(e),
172
+ width: t
173
+ })
174
+ ]
175
+ });
176
+ }
177
+ });
178
+ };
179
+ //#endregion
180
+ export { P as Candlestick };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { HRule as e } from "../rules.js";
3
+ import { ChartSvg as t } from "../svg.js";
4
+ import { Label as n } from "../text.js";
5
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
+ //#region src/charts/basics/daily-empty.tsx
7
+ var a = ({ floor: a, height: o, name: s, width: c }) => /* @__PURE__ */ i(t, {
8
+ height: o,
9
+ label: s ?? "No data",
10
+ width: c,
11
+ children: [/* @__PURE__ */ r(e, {
12
+ x0: 8,
13
+ x1: c - 8,
14
+ y: a
15
+ }), /* @__PURE__ */ r(n, {
16
+ anchor: "middle",
17
+ voice: "axis",
18
+ x: c / 2,
19
+ y: a - 12,
20
+ children: "No data"
21
+ })]
22
+ });
23
+ //#endregion
24
+ export { a as DailyEmpty };
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { keyOf as e } from "../../schema/key.js";
3
+ //#region src/charts/basics/daily-readings.ts
4
+ var t = (t) => t.flatMap((t) => {
5
+ let n = new Date(t.date);
6
+ return Number.isNaN(n.getTime()) ? [] : [{
7
+ date: n,
8
+ key: e(t),
9
+ value: t.value !== null && Number.isFinite(t.value) ? t.value : null
10
+ }];
11
+ }).toSorted((e, t) => e.date.getTime() - t.date.getTime()), n = (e, t, n) => e.map((e) => [t(e.date), e.value === null ? "No reading" : n(e.value)]), r = (e) => e.flatMap((e, t) => e.value === null ? [] : [t]), i = (e) => ({
12
+ live: r(e),
13
+ readings: e
14
+ }), a = (e, t) => `${e.key}#${t}`, o = (e, t) => e[t].value ?? 0, s = (e, t, n, r) => n === void 0 ? r : t.find((t) => e[t].key === n) ?? -1, c = (e) => e.value !== null;
15
+ //#endregion
16
+ export { s as heroOf, c as isLive, r as liveOf, a as reactKeyOf, n as readingRows, t as readingsOf, i as seriesOf, o as valueAt };
@@ -0,0 +1,225 @@
1
+ "use client";
2
+ //#region src/charts/basics/dot-heat.data.ts
3
+ var e = {
4
+ columns: [
5
+ "0:00",
6
+ "1:00",
7
+ "2:00",
8
+ "3:00",
9
+ "4:00",
10
+ "5:00",
11
+ "6:00",
12
+ "7:00",
13
+ "8:00",
14
+ "9:00",
15
+ "10:00",
16
+ "11:00",
17
+ "12:00",
18
+ "13:00",
19
+ "14:00",
20
+ "15:00",
21
+ "16:00",
22
+ "17:00",
23
+ "18:00",
24
+ "19:00",
25
+ "20:00",
26
+ "21:00",
27
+ "22:00",
28
+ "23:00"
29
+ ],
30
+ rows: [
31
+ "Mon",
32
+ "Tue",
33
+ "Wed",
34
+ "Thu",
35
+ "Fri",
36
+ "Sat",
37
+ "Sun"
38
+ ],
39
+ values: [
40
+ [
41
+ 2.1,
42
+ 2.2,
43
+ 2.2,
44
+ 2.2,
45
+ 2.3,
46
+ 2.4,
47
+ 2.5,
48
+ 4.8,
49
+ 7.1,
50
+ 5.1,
51
+ 5,
52
+ 5,
53
+ 6.6,
54
+ 6.1,
55
+ 5.3,
56
+ 4.9,
57
+ 5.1,
58
+ 5.3,
59
+ 4.8,
60
+ 4.2,
61
+ 4.2,
62
+ 3.8,
63
+ 3.6,
64
+ 3.2
65
+ ],
66
+ [
67
+ 2.7,
68
+ 2.7,
69
+ 2.6,
70
+ 2.6,
71
+ 2.5,
72
+ 2.6,
73
+ 2.7,
74
+ 4.6,
75
+ 6.7,
76
+ 5.1,
77
+ 5,
78
+ 5,
79
+ 6.4,
80
+ 5.9,
81
+ 5.3,
82
+ 4.9,
83
+ 4.9,
84
+ 5.1,
85
+ 4.7,
86
+ 4,
87
+ 4,
88
+ 3.6,
89
+ 3.4,
90
+ 3.1
91
+ ],
92
+ [
93
+ 2.8,
94
+ 2.8,
95
+ 2.6,
96
+ 2.6,
97
+ 2.6,
98
+ 2.6,
99
+ 2.7,
100
+ 4.6,
101
+ 6.5,
102
+ 5,
103
+ 5,
104
+ 5,
105
+ 6.2,
106
+ 5.8,
107
+ 5.2,
108
+ 4.9,
109
+ 5,
110
+ 5.1,
111
+ 4.7,
112
+ 4.1,
113
+ 3.9,
114
+ 3.7,
115
+ 3.4,
116
+ 3.1
117
+ ],
118
+ [
119
+ 2.7,
120
+ 2.8,
121
+ 2.6,
122
+ 2.6,
123
+ 2.5,
124
+ 2.6,
125
+ 2.7,
126
+ 4.5,
127
+ 6.4,
128
+ 5,
129
+ 4.9,
130
+ 4.9,
131
+ 6.3,
132
+ 5.9,
133
+ 5.2,
134
+ 4.9,
135
+ 5,
136
+ 5.2,
137
+ 4.7,
138
+ 4.1,
139
+ 4,
140
+ 3.7,
141
+ 3.4,
142
+ 3.2
143
+ ],
144
+ [
145
+ 2.8,
146
+ 2.8,
147
+ 2.7,
148
+ 2.6,
149
+ 2.6,
150
+ 2.6,
151
+ 2.8,
152
+ 4.9,
153
+ 7,
154
+ 5.2,
155
+ 5,
156
+ 4.9,
157
+ 6.2,
158
+ 5.8,
159
+ 5.3,
160
+ 5,
161
+ 5,
162
+ 4.9,
163
+ 4.4,
164
+ 3.9,
165
+ 3.8,
166
+ 3.5,
167
+ 3.3,
168
+ 3.1
169
+ ],
170
+ [
171
+ 3.9,
172
+ 3.9,
173
+ 3.8,
174
+ 3.7,
175
+ 3.6,
176
+ 3.6,
177
+ 3.6,
178
+ 3.8,
179
+ 4.7,
180
+ 5,
181
+ 5,
182
+ 4.9,
183
+ 5,
184
+ 4.7,
185
+ 4.6,
186
+ 4.6,
187
+ 4.5,
188
+ 4.4,
189
+ 4.1,
190
+ 3.8,
191
+ 3.9,
192
+ 3.7,
193
+ 3.7,
194
+ 3.5
195
+ ],
196
+ [
197
+ 3.6,
198
+ 3.8,
199
+ 3.5,
200
+ 3.7,
201
+ 3.6,
202
+ 3.6,
203
+ 3.7,
204
+ 3.9,
205
+ 4.6,
206
+ 4.9,
207
+ 5,
208
+ 5,
209
+ 5,
210
+ 4.7,
211
+ 4.7,
212
+ 4.6,
213
+ 4.5,
214
+ 4.4,
215
+ 4.1,
216
+ 3.9,
217
+ 4,
218
+ 3.8,
219
+ 3.7,
220
+ 3.7
221
+ ]
222
+ ]
223
+ };
224
+ //#endregion
225
+ export { e as dotHeatDemo };