@howells/hairline 0.0.0-stage → 0.2.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 (456) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +148 -2
  4. package/lib/charts/axes.js +5 -0
  5. package/lib/charts/basics/candlestick.data.js +44 -0
  6. package/lib/charts/basics/candlestick.js +180 -0
  7. package/lib/charts/basics/daily-empty.js +24 -0
  8. package/lib/charts/basics/daily-readings.js +16 -0
  9. package/lib/charts/basics/dot-heat.data.js +225 -0
  10. package/lib/charts/basics/dot-heat.js +174 -0
  11. package/lib/charts/basics/dumbbell-queue.js +203 -0
  12. package/lib/charts/basics/hairline-area.js +208 -0
  13. package/lib/charts/basics/hairline-line.js +195 -0
  14. package/lib/charts/basics/nested-treemap.data.js +55 -0
  15. package/lib/charts/basics/nested-treemap.js +191 -0
  16. package/lib/charts/basics/paired-rungs.data.js +31 -0
  17. package/lib/charts/basics/paired-rungs.js +151 -0
  18. package/lib/charts/basics/plumb-scatter.js +229 -0
  19. package/lib/charts/basics/rung-bars.js +178 -0
  20. package/lib/charts/basics/rung-geometry.js +6 -0
  21. package/lib/charts/basics/rung-histogram.data.js +73 -0
  22. package/lib/charts/basics/rung-histogram.js +153 -0
  23. package/lib/charts/basics/rung-waterfall.data.js +30 -0
  24. package/lib/charts/basics/rung-waterfall.js +150 -0
  25. package/lib/charts/basics/rungs.js +22 -0
  26. package/lib/charts/basics/series-key.js +26 -0
  27. package/lib/charts/basics/stacked-rungs.data.js +42 -0
  28. package/lib/charts/basics/stacked-rungs.js +174 -0
  29. package/lib/charts/basics/stream-ribbon.data.js +124 -0
  30. package/lib/charts/basics/stream-ribbon.js +336 -0
  31. package/lib/charts/basics/tick-box.data.js +50 -0
  32. package/lib/charts/basics/tick-box.js +226 -0
  33. package/lib/charts/basics/tick-donut.data.js +30 -0
  34. package/lib/charts/basics/tick-donut.js +210 -0
  35. package/lib/charts/basics/tick-gauge.data.js +8 -0
  36. package/lib/charts/basics/tick-gauge.js +169 -0
  37. package/lib/charts/basics/tick-rows.data.js +30 -0
  38. package/lib/charts/basics/tick-rows.js +121 -0
  39. package/lib/charts/basics/util-a.js +15 -0
  40. package/lib/charts/basics/util-b.js +13 -0
  41. package/lib/charts/big/circular-graph.data.js +827 -0
  42. package/lib/charts/big/circular-graph.js +289 -0
  43. package/lib/charts/big/force-galaxy-model.js +167 -0
  44. package/lib/charts/big/force-galaxy.data.js +813 -0
  45. package/lib/charts/big/force-galaxy.js +276 -0
  46. package/lib/charts/big/thread-triptych.data.js +204 -0
  47. package/lib/charts/big/thread-triptych.js +334 -0
  48. package/lib/charts/board/room.js +6 -0
  49. package/lib/charts/board/slope.js +176 -0
  50. package/lib/charts/board/spread.js +28 -0
  51. package/lib/charts/control.js +18 -0
  52. package/lib/charts/core.js +84 -0
  53. package/lib/charts/data-table.js +34 -0
  54. package/lib/charts/fills.js +153 -0
  55. package/lib/charts/forms/area-difference.data.js +62 -0
  56. package/lib/charts/forms/area-difference.js +192 -0
  57. package/lib/charts/forms/brush-math.js +42 -0
  58. package/lib/charts/forms/brush-strip.js +199 -0
  59. package/lib/charts/forms/brushed-overview.data.js +374 -0
  60. package/lib/charts/forms/brushed-overview.js +162 -0
  61. package/lib/charts/forms/chord-ring.data.js +140 -0
  62. package/lib/charts/forms/chord-ring.js +167 -0
  63. package/lib/charts/forms/circle-pack.data.js +80 -0
  64. package/lib/charts/forms/circle-pack.js +99 -0
  65. package/lib/charts/forms/hatched-stack.data.js +71 -0
  66. package/lib/charts/forms/hatched-stack.js +228 -0
  67. package/lib/charts/forms/radial-year.data.js +13 -0
  68. package/lib/charts/forms/radial-year.js +156 -0
  69. package/lib/charts/frame.js +73 -0
  70. package/lib/charts/glance/aggregate-sankey.data.js +74 -0
  71. package/lib/charts/glance/aggregate-sankey.js +242 -0
  72. package/lib/charts/glance/bar-race.data.js +122 -0
  73. package/lib/charts/glance/bar-race.js +246 -0
  74. package/lib/charts/glance/big-slice.data.js +41 -0
  75. package/lib/charts/glance/big-slice.js +238 -0
  76. package/lib/charts/glance/chunky-bars.data.js +22 -0
  77. package/lib/charts/glance/chunky-bars.js +113 -0
  78. package/lib/charts/glance/circular-graph.data.js +146 -0
  79. package/lib/charts/glance/circular-graph.js +138 -0
  80. package/lib/charts/glance/control-slot.js +9 -0
  81. package/lib/charts/glance/diverging-bar.data.js +34 -0
  82. package/lib/charts/glance/diverging-bar.js +154 -0
  83. package/lib/charts/glance/dot-waffle.data.js +26 -0
  84. package/lib/charts/glance/dot-waffle.js +179 -0
  85. package/lib/charts/glance/draw-in.data.js +9 -0
  86. package/lib/charts/glance/draw-in.goals.json.js +289 -0
  87. package/lib/charts/glance/draw-in.js +214 -0
  88. package/lib/charts/glance/dynamic-stream.data.js +6 -0
  89. package/lib/charts/glance/dynamic-stream.js +189 -0
  90. package/lib/charts/glance/force-graph.data.js +77 -0
  91. package/lib/charts/glance/force-graph.js +211 -0
  92. package/lib/charts/glance/jitter-strip.data.js +10 -0
  93. package/lib/charts/glance/jitter-strip.easter.json.js +430 -0
  94. package/lib/charts/glance/jitter-strip.js +157 -0
  95. package/lib/charts/glance/link-bundle.js +51 -0
  96. package/lib/charts/glance/matrix-heat-glance.data.js +108 -0
  97. package/lib/charts/glance/matrix-heat-glance.js +170 -0
  98. package/lib/charts/glance/pictorial-bar.data.js +22 -0
  99. package/lib/charts/glance/pictorial-bar.js +180 -0
  100. package/lib/charts/glance/rainfall-dual-area.data.js +177 -0
  101. package/lib/charts/glance/rainfall-dual-area.js +192 -0
  102. package/lib/charts/glance/rank-strip.data.js +76 -0
  103. package/lib/charts/glance/rank-strip.js +172 -0
  104. package/lib/charts/glance/scatter-labels.js +60 -0
  105. package/lib/charts/glance/scatter-morph.data.js +78 -0
  106. package/lib/charts/glance/scatter-morph.js +338 -0
  107. package/lib/charts/glance/single-axis.data.js +6 -0
  108. package/lib/charts/glance/single-axis.js +150 -0
  109. package/lib/charts/glance/single-axis.tides.json.js +180 -0
  110. package/lib/charts/glance/stagger-wave.data.js +66 -0
  111. package/lib/charts/glance/stagger-wave.js +132 -0
  112. package/lib/charts/glance/tree-lr.data.js +41 -0
  113. package/lib/charts/glance/tree-lr.js +135 -0
  114. package/lib/charts/glance/util-a.js +49 -0
  115. package/lib/charts/glance/util-b.js +19 -0
  116. package/lib/charts/glance/violin.data.js +9 -0
  117. package/lib/charts/glance/violin.js +185 -0
  118. package/lib/charts/glance/violin.tenors.json.js +5 -0
  119. package/lib/charts/hooks.js +154 -0
  120. package/lib/charts/hover.js +19 -0
  121. package/lib/charts/lupi/arc-matrix.data.js +83 -0
  122. package/lib/charts/lupi/arc-matrix.js +146 -0
  123. package/lib/charts/lupi/ballot-tally.data.js +22 -0
  124. package/lib/charts/lupi/ballot-tally.js +125 -0
  125. package/lib/charts/lupi/barcode-lollipop.data.js +195 -0
  126. package/lib/charts/lupi/barcode-lollipop.js +161 -0
  127. package/lib/charts/lupi/brand-spectrum.data.js +70 -0
  128. package/lib/charts/lupi/brand-spectrum.js +233 -0
  129. package/lib/charts/lupi/bubble-almanac.data.js +689 -0
  130. package/lib/charts/lupi/bubble-almanac.js +164 -0
  131. package/lib/charts/lupi/calendar-heat.data.js +399 -0
  132. package/lib/charts/lupi/calendar-heat.js +175 -0
  133. package/lib/charts/lupi/cluster-field.data.js +83 -0
  134. package/lib/charts/lupi/cluster-field.js +173 -0
  135. package/lib/charts/lupi/dot-cascade.data.js +54 -0
  136. package/lib/charts/lupi/dot-cascade.js +124 -0
  137. package/lib/charts/lupi/dotty-matrix.data.js +170 -0
  138. package/lib/charts/lupi/dotty-matrix.js +126 -0
  139. package/lib/charts/lupi/hourglass-stream.data.js +30 -0
  140. package/lib/charts/lupi/hourglass-stream.js +158 -0
  141. package/lib/charts/lupi/hundred-field.data.js +38 -0
  142. package/lib/charts/lupi/hundred-field.js +237 -0
  143. package/lib/charts/lupi/launch-fan.data.js +315 -0
  144. package/lib/charts/lupi/launch-fan.js +198 -0
  145. package/lib/charts/lupi/matrix-heat.data.js +97 -0
  146. package/lib/charts/lupi/matrix-heat.js +246 -0
  147. package/lib/charts/lupi/parallel-coordinates.data.js +54 -0
  148. package/lib/charts/lupi/parallel-coordinates.js +218 -0
  149. package/lib/charts/lupi/radial-convergence.data.js +178 -0
  150. package/lib/charts/lupi/radial-convergence.js +208 -0
  151. package/lib/charts/lupi/radial-patchwork.data.js +454 -0
  152. package/lib/charts/lupi/radial-patchwork.js +181 -0
  153. package/lib/charts/lupi/ridgeline.data.js +1834 -0
  154. package/lib/charts/lupi/ridgeline.js +195 -0
  155. package/lib/charts/lupi/trend-lineage.data.js +51 -0
  156. package/lib/charts/lupi/trend-lineage.js +198 -0
  157. package/lib/charts/lupi/type-colonnade.data.js +18 -0
  158. package/lib/charts/lupi/type-colonnade.js +198 -0
  159. package/lib/charts/lupi/util-a.js +14 -0
  160. package/lib/charts/lupi/util-b.js +12 -0
  161. package/lib/charts/maps/choropleth.js +295 -0
  162. package/lib/charts/maps/geo.js +84 -0
  163. package/lib/charts/maps/legend.js +83 -0
  164. package/lib/charts/maps/step-fill.js +9 -0
  165. package/lib/charts/maps/us-choropleth.data.js +249 -0
  166. package/lib/charts/maps/us-choropleth.js +41 -0
  167. package/lib/charts/maps/world-choropleth.data.js +681 -0
  168. package/lib/charts/maps/world-choropleth.js +46 -0
  169. package/lib/charts/markers.js +35 -0
  170. package/lib/charts/marks.js +31 -0
  171. package/lib/charts/motion.js +11 -0
  172. package/lib/charts/originals/daily-users.data.js +101 -0
  173. package/lib/charts/originals/daily-users.js +203 -0
  174. package/lib/charts/originals/feature-rank.data.js +92 -0
  175. package/lib/charts/originals/feature-rank.js +167 -0
  176. package/lib/charts/originals/format.js +5 -0
  177. package/lib/charts/originals/key.js +26 -0
  178. package/lib/charts/originals/response-time.data.js +98 -0
  179. package/lib/charts/originals/response-time.js +187 -0
  180. package/lib/charts/originals/revenue-by-plan.data.js +26 -0
  181. package/lib/charts/originals/revenue-by-plan.js +248 -0
  182. package/lib/charts/playback.js +68 -0
  183. package/lib/charts/plot-note.js +27 -0
  184. package/lib/charts/roles.js +5 -0
  185. package/lib/charts/rules.js +66 -0
  186. package/lib/charts/scale-context.js +6 -0
  187. package/lib/charts/shapes.js +8 -0
  188. package/lib/charts/shared-options.js +25 -0
  189. package/lib/charts/svg.js +43 -0
  190. package/lib/charts/text.js +30 -0
  191. package/lib/charts/texture-ids.js +20 -0
  192. package/lib/charts/texture.js +286 -0
  193. package/lib/charts/util.js +43 -0
  194. package/lib/charts/value-grid.js +26 -0
  195. package/lib/draw.js +27 -0
  196. package/lib/entries/dumbbell-queue.js +2 -0
  197. package/lib/entries/hairline-area.js +2 -0
  198. package/lib/entries/hairline-line.js +2 -0
  199. package/lib/entries/plumb-scatter.js +2 -0
  200. package/lib/entries/rung-bars.js +2 -0
  201. package/lib/entries/slope.js +2 -0
  202. package/lib/frame.js +2 -0
  203. package/lib/hairline.css +1385 -0
  204. package/lib/index.js +72 -0
  205. package/lib/json-schema/dumbbell-queue.json +258 -0
  206. package/lib/json-schema/hairline-area.json +262 -0
  207. package/lib/json-schema/hairline-line.json +256 -0
  208. package/lib/json-schema/index.json +50 -0
  209. package/lib/json-schema/plumb-scatter.json +363 -0
  210. package/lib/json-schema/rung-bars.json +230 -0
  211. package/lib/json-schema/slope.json +333 -0
  212. package/lib/kit.js +16 -0
  213. package/lib/lib/format.js +29 -0
  214. package/lib/lib/random.js +8 -0
  215. package/lib/maps.js +4 -0
  216. package/lib/schema/daily.js +9 -0
  217. package/lib/schema/dumbbell-queue.js +28 -0
  218. package/lib/schema/format.js +72 -0
  219. package/lib/schema/hairline-area.js +24 -0
  220. package/lib/schema/hairline-line.js +23 -0
  221. package/lib/schema/key.js +4 -0
  222. package/lib/schema/metrics.js +26 -0
  223. package/lib/schema/motion.js +12 -0
  224. package/lib/schema/options.js +21 -0
  225. package/lib/schema/plumb-scatter.js +48 -0
  226. package/lib/schema/registry.js +132 -0
  227. package/lib/schema/rung-bars.js +25 -0
  228. package/lib/schema/scale.js +9 -0
  229. package/lib/schema/slope.js +28 -0
  230. package/lib/schema/validate.js +25 -0
  231. package/lib/schema.js +16 -0
  232. package/lib/theme/derive.js +98 -0
  233. package/lib/theme.css +443 -0
  234. package/lib/theme.js +1 -0
  235. package/lib/tokens.css +306 -0
  236. package/lib/types/charts/axes.d.ts +14 -0
  237. package/lib/types/charts/basics/candlestick.d.ts +22 -0
  238. package/lib/types/charts/basics/candlestick.data.d.ts +10 -0
  239. package/lib/types/charts/basics/daily-empty.d.ts +7 -0
  240. package/lib/types/charts/basics/daily-readings.d.ts +38 -0
  241. package/lib/types/charts/basics/dot-heat.d.ts +19 -0
  242. package/lib/types/charts/basics/dot-heat.data.d.ts +28 -0
  243. package/lib/types/charts/basics/dumbbell-queue.d.ts +15 -0
  244. package/lib/types/charts/basics/hairline-area.d.ts +18 -0
  245. package/lib/types/charts/basics/hairline-line.d.ts +18 -0
  246. package/lib/types/charts/basics/nested-treemap.d.ts +18 -0
  247. package/lib/types/charts/basics/nested-treemap.data.d.ts +30 -0
  248. package/lib/types/charts/basics/paired-rungs.d.ts +21 -0
  249. package/lib/types/charts/basics/paired-rungs.data.d.ts +43 -0
  250. package/lib/types/charts/basics/plumb-scatter.d.ts +14 -0
  251. package/lib/types/charts/basics/rung-bars.d.ts +16 -0
  252. package/lib/types/charts/basics/rung-geometry.d.ts +6 -0
  253. package/lib/types/charts/basics/rung-histogram.d.ts +22 -0
  254. package/lib/types/charts/basics/rung-histogram.data.d.ts +34 -0
  255. package/lib/types/charts/basics/rung-waterfall.d.ts +19 -0
  256. package/lib/types/charts/basics/rung-waterfall.data.d.ts +31 -0
  257. package/lib/types/charts/basics/rungs.d.ts +28 -0
  258. package/lib/types/charts/basics/series-key.d.ts +19 -0
  259. package/lib/types/charts/basics/stacked-rungs.d.ts +20 -0
  260. package/lib/types/charts/basics/stacked-rungs.data.d.ts +26 -0
  261. package/lib/types/charts/basics/stream-ribbon.d.ts +19 -0
  262. package/lib/types/charts/basics/stream-ribbon.data.d.ts +29 -0
  263. package/lib/types/charts/basics/tick-box.d.ts +19 -0
  264. package/lib/types/charts/basics/tick-box.data.d.ts +30 -0
  265. package/lib/types/charts/basics/tick-donut.d.ts +24 -0
  266. package/lib/types/charts/basics/tick-donut.data.d.ts +25 -0
  267. package/lib/types/charts/basics/tick-gauge.d.ts +22 -0
  268. package/lib/types/charts/basics/tick-gauge.data.d.ts +24 -0
  269. package/lib/types/charts/basics/tick-rows.d.ts +18 -0
  270. package/lib/types/charts/basics/tick-rows.data.d.ts +23 -0
  271. package/lib/types/charts/basics/util-a.d.ts +10 -0
  272. package/lib/types/charts/basics/util-b.d.ts +13 -0
  273. package/lib/types/charts/big/circular-graph.d.ts +20 -0
  274. package/lib/types/charts/big/circular-graph.data.d.ts +46 -0
  275. package/lib/types/charts/big/force-galaxy-model.d.ts +109 -0
  276. package/lib/types/charts/big/force-galaxy.d.ts +18 -0
  277. package/lib/types/charts/big/force-galaxy.data.d.ts +48 -0
  278. package/lib/types/charts/big/thread-triptych.d.ts +17 -0
  279. package/lib/types/charts/big/thread-triptych.data.d.ts +41 -0
  280. package/lib/types/charts/board/room.d.ts +18 -0
  281. package/lib/types/charts/board/slope.d.ts +14 -0
  282. package/lib/types/charts/board/spread.d.ts +5 -0
  283. package/lib/types/charts/control.d.ts +17 -0
  284. package/lib/types/charts/core.d.ts +77 -0
  285. package/lib/types/charts/data-table.d.ts +18 -0
  286. package/lib/types/charts/fills.d.ts +103 -0
  287. package/lib/types/charts/forms/area-difference.d.ts +9 -0
  288. package/lib/types/charts/forms/area-difference.data.d.ts +26 -0
  289. package/lib/types/charts/forms/brush-math.d.ts +19 -0
  290. package/lib/types/charts/forms/brush-strip.d.ts +19 -0
  291. package/lib/types/charts/forms/brushed-overview.d.ts +12 -0
  292. package/lib/types/charts/forms/brushed-overview.data.d.ts +16 -0
  293. package/lib/types/charts/forms/chord-ring.d.ts +12 -0
  294. package/lib/types/charts/forms/chord-ring.data.d.ts +29 -0
  295. package/lib/types/charts/forms/circle-pack.d.ts +9 -0
  296. package/lib/types/charts/forms/circle-pack.data.d.ts +23 -0
  297. package/lib/types/charts/forms/hatched-stack.d.ts +10 -0
  298. package/lib/types/charts/forms/hatched-stack.data.d.ts +36 -0
  299. package/lib/types/charts/forms/radial-year.d.ts +8 -0
  300. package/lib/types/charts/forms/radial-year.data.d.ts +17 -0
  301. package/lib/types/charts/frame.d.ts +21 -0
  302. package/lib/types/charts/glance/aggregate-sankey.d.ts +23 -0
  303. package/lib/types/charts/glance/aggregate-sankey.data.d.ts +32 -0
  304. package/lib/types/charts/glance/bar-race.d.ts +20 -0
  305. package/lib/types/charts/glance/bar-race.data.d.ts +32 -0
  306. package/lib/types/charts/glance/big-slice.d.ts +27 -0
  307. package/lib/types/charts/glance/big-slice.data.d.ts +30 -0
  308. package/lib/types/charts/glance/chunky-bars.d.ts +18 -0
  309. package/lib/types/charts/glance/chunky-bars.data.d.ts +24 -0
  310. package/lib/types/charts/glance/circular-graph.d.ts +19 -0
  311. package/lib/types/charts/glance/circular-graph.data.d.ts +43 -0
  312. package/lib/types/charts/glance/control-slot.d.ts +9 -0
  313. package/lib/types/charts/glance/diverging-bar.d.ts +19 -0
  314. package/lib/types/charts/glance/diverging-bar.data.d.ts +27 -0
  315. package/lib/types/charts/glance/dot-waffle.d.ts +19 -0
  316. package/lib/types/charts/glance/dot-waffle.data.d.ts +31 -0
  317. package/lib/types/charts/glance/draw-in.d.ts +20 -0
  318. package/lib/types/charts/glance/draw-in.data.d.ts +6 -0
  319. package/lib/types/charts/glance/dynamic-stream.d.ts +22 -0
  320. package/lib/types/charts/glance/dynamic-stream.data.d.ts +7 -0
  321. package/lib/types/charts/glance/force-graph.d.ts +16 -0
  322. package/lib/types/charts/glance/force-graph.data.d.ts +45 -0
  323. package/lib/types/charts/glance/jitter-strip.d.ts +24 -0
  324. package/lib/types/charts/glance/jitter-strip.data.d.ts +27 -0
  325. package/lib/types/charts/glance/link-bundle.d.ts +22 -0
  326. package/lib/types/charts/glance/matrix-heat-glance.d.ts +22 -0
  327. package/lib/types/charts/glance/matrix-heat-glance.data.d.ts +35 -0
  328. package/lib/types/charts/glance/pictorial-bar.d.ts +20 -0
  329. package/lib/types/charts/glance/pictorial-bar.data.d.ts +27 -0
  330. package/lib/types/charts/glance/rainfall-dual-area.d.ts +19 -0
  331. package/lib/types/charts/glance/rainfall-dual-area.data.d.ts +32 -0
  332. package/lib/types/charts/glance/rank-strip.d.ts +19 -0
  333. package/lib/types/charts/glance/rank-strip.data.d.ts +36 -0
  334. package/lib/types/charts/glance/scatter-labels.d.ts +23 -0
  335. package/lib/types/charts/glance/scatter-morph.d.ts +22 -0
  336. package/lib/types/charts/glance/scatter-morph.data.d.ts +30 -0
  337. package/lib/types/charts/glance/single-axis.d.ts +27 -0
  338. package/lib/types/charts/glance/single-axis.data.d.ts +6 -0
  339. package/lib/types/charts/glance/stagger-wave.d.ts +18 -0
  340. package/lib/types/charts/glance/stagger-wave.data.d.ts +26 -0
  341. package/lib/types/charts/glance/tree-lr.d.ts +16 -0
  342. package/lib/types/charts/glance/tree-lr.data.d.ts +27 -0
  343. package/lib/types/charts/glance/util-a.d.ts +31 -0
  344. package/lib/types/charts/glance/util-b.d.ts +12 -0
  345. package/lib/types/charts/glance/violin.d.ts +22 -0
  346. package/lib/types/charts/glance/violin.data.d.ts +24 -0
  347. package/lib/types/charts/hooks.d.ts +109 -0
  348. package/lib/types/charts/hover.d.ts +26 -0
  349. package/lib/types/charts/lupi/arc-matrix.d.ts +18 -0
  350. package/lib/types/charts/lupi/arc-matrix.data.d.ts +28 -0
  351. package/lib/types/charts/lupi/ballot-tally.d.ts +19 -0
  352. package/lib/types/charts/lupi/ballot-tally.data.d.ts +28 -0
  353. package/lib/types/charts/lupi/barcode-lollipop.d.ts +19 -0
  354. package/lib/types/charts/lupi/barcode-lollipop.data.d.ts +26 -0
  355. package/lib/types/charts/lupi/brand-spectrum.d.ts +28 -0
  356. package/lib/types/charts/lupi/brand-spectrum.data.d.ts +34 -0
  357. package/lib/types/charts/lupi/bubble-almanac.d.ts +22 -0
  358. package/lib/types/charts/lupi/bubble-almanac.data.d.ts +45 -0
  359. package/lib/types/charts/lupi/calendar-heat.d.ts +19 -0
  360. package/lib/types/charts/lupi/calendar-heat.data.d.ts +20 -0
  361. package/lib/types/charts/lupi/cluster-field.d.ts +21 -0
  362. package/lib/types/charts/lupi/cluster-field.data.d.ts +52 -0
  363. package/lib/types/charts/lupi/dot-cascade.d.ts +22 -0
  364. package/lib/types/charts/lupi/dot-cascade.data.d.ts +24 -0
  365. package/lib/types/charts/lupi/dotty-matrix.d.ts +17 -0
  366. package/lib/types/charts/lupi/dotty-matrix.data.d.ts +32 -0
  367. package/lib/types/charts/lupi/hourglass-stream.d.ts +18 -0
  368. package/lib/types/charts/lupi/hourglass-stream.data.d.ts +27 -0
  369. package/lib/types/charts/lupi/hundred-field.d.ts +18 -0
  370. package/lib/types/charts/lupi/hundred-field.data.d.ts +24 -0
  371. package/lib/types/charts/lupi/launch-fan.d.ts +37 -0
  372. package/lib/types/charts/lupi/launch-fan.data.d.ts +41 -0
  373. package/lib/types/charts/lupi/matrix-heat.d.ts +20 -0
  374. package/lib/types/charts/lupi/matrix-heat.data.d.ts +29 -0
  375. package/lib/types/charts/lupi/parallel-coordinates.d.ts +23 -0
  376. package/lib/types/charts/lupi/parallel-coordinates.data.d.ts +40 -0
  377. package/lib/types/charts/lupi/radial-convergence.d.ts +15 -0
  378. package/lib/types/charts/lupi/radial-convergence.data.d.ts +24 -0
  379. package/lib/types/charts/lupi/radial-patchwork.d.ts +16 -0
  380. package/lib/types/charts/lupi/radial-patchwork.data.d.ts +35 -0
  381. package/lib/types/charts/lupi/ridgeline.d.ts +23 -0
  382. package/lib/types/charts/lupi/ridgeline.data.d.ts +19 -0
  383. package/lib/types/charts/lupi/trend-lineage.d.ts +18 -0
  384. package/lib/types/charts/lupi/trend-lineage.data.d.ts +56 -0
  385. package/lib/types/charts/lupi/type-colonnade.d.ts +20 -0
  386. package/lib/types/charts/lupi/type-colonnade.data.d.ts +30 -0
  387. package/lib/types/charts/lupi/util-a.d.ts +9 -0
  388. package/lib/types/charts/lupi/util-b.d.ts +11 -0
  389. package/lib/types/charts/maps/choropleth.d.ts +33 -0
  390. package/lib/types/charts/maps/geo.d.ts +48 -0
  391. package/lib/types/charts/maps/legend.d.ts +14 -0
  392. package/lib/types/charts/maps/step-fill.d.ts +6 -0
  393. package/lib/types/charts/maps/us-choropleth.d.ts +25 -0
  394. package/lib/types/charts/maps/us-choropleth.data.d.ts +23 -0
  395. package/lib/types/charts/maps/world-choropleth.d.ts +22 -0
  396. package/lib/types/charts/maps/world-choropleth.data.d.ts +35 -0
  397. package/lib/types/charts/markers.d.ts +42 -0
  398. package/lib/types/charts/marks.d.ts +58 -0
  399. package/lib/types/charts/motion.d.ts +12 -0
  400. package/lib/types/charts/originals/daily-users.d.ts +13 -0
  401. package/lib/types/charts/originals/daily-users.data.d.ts +17 -0
  402. package/lib/types/charts/originals/feature-rank.d.ts +13 -0
  403. package/lib/types/charts/originals/feature-rank.data.d.ts +29 -0
  404. package/lib/types/charts/originals/format.d.ts +2 -0
  405. package/lib/types/charts/originals/key.d.ts +16 -0
  406. package/lib/types/charts/originals/response-time.d.ts +11 -0
  407. package/lib/types/charts/originals/response-time.data.d.ts +24 -0
  408. package/lib/types/charts/originals/revenue-by-plan.d.ts +12 -0
  409. package/lib/types/charts/originals/revenue-by-plan.data.d.ts +26 -0
  410. package/lib/types/charts/playback.d.ts +42 -0
  411. package/lib/types/charts/plot-note.d.ts +37 -0
  412. package/lib/types/charts/roles.d.ts +28 -0
  413. package/lib/types/charts/rules.d.ts +62 -0
  414. package/lib/types/charts/scale-context.d.ts +3 -0
  415. package/lib/types/charts/shapes.d.ts +9 -0
  416. package/lib/types/charts/shared-options.d.ts +25 -0
  417. package/lib/types/charts/svg.d.ts +24 -0
  418. package/lib/types/charts/text.d.ts +36 -0
  419. package/lib/types/charts/texture-ids.d.ts +24 -0
  420. package/lib/types/charts/texture.d.ts +185 -0
  421. package/lib/types/charts/util.d.ts +66 -0
  422. package/lib/types/charts/value-grid.d.ts +22 -0
  423. package/lib/types/draw.d.ts +279 -0
  424. package/lib/types/entries/dumbbell-queue.d.ts +2 -0
  425. package/lib/types/entries/hairline-area.d.ts +2 -0
  426. package/lib/types/entries/hairline-line.d.ts +2 -0
  427. package/lib/types/entries/plumb-scatter.d.ts +2 -0
  428. package/lib/types/entries/rung-bars.d.ts +2 -0
  429. package/lib/types/entries/slope.d.ts +2 -0
  430. package/lib/types/frame.d.ts +2 -0
  431. package/lib/types/index.d.ts +82 -0
  432. package/lib/types/kit.d.ts +22 -0
  433. package/lib/types/lib/format.d.ts +58 -0
  434. package/lib/types/lib/random.d.ts +5 -0
  435. package/lib/types/maps.d.ts +2 -0
  436. package/lib/types/schema/daily.d.ts +14 -0
  437. package/lib/types/schema/dumbbell-queue.d.ts +91 -0
  438. package/lib/types/schema/format.d.ts +101 -0
  439. package/lib/types/schema/hairline-area.d.ts +83 -0
  440. package/lib/types/schema/hairline-line.d.ts +85 -0
  441. package/lib/types/schema/key.d.ts +12 -0
  442. package/lib/types/schema/metrics.d.ts +26 -0
  443. package/lib/types/schema/motion.d.ts +22 -0
  444. package/lib/types/schema/options.d.ts +51 -0
  445. package/lib/types/schema/plumb-scatter.d.ts +124 -0
  446. package/lib/types/schema/registry.d.ts +309 -0
  447. package/lib/types/schema/rung-bars.d.ts +84 -0
  448. package/lib/types/schema/scale.d.ts +36 -0
  449. package/lib/types/schema/slope.d.ts +120 -0
  450. package/lib/types/schema/validate.d.ts +29 -0
  451. package/lib/types/schema.d.ts +30 -0
  452. package/lib/types/theme/derive.d.ts +23 -0
  453. package/lib/types/theme.d.ts +2 -0
  454. package/lib/vendor/us-atlas/states-10m.json.js +13855 -0
  455. package/lib/vendor/world-atlas/countries-110m.json.js +9357 -0
  456. package/package.json +160 -3
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ import { CURSOR as e, GRID_H as t, GRID_V as n, RULE_TARGET as r, RULE_ZERO as i } from "./roles.js";
3
+ import { cx as a } from "./util.js";
4
+ import { crisp as o } from "./axes.js";
5
+ import { STEM as s, TICK as c } from "./marks.js";
6
+ import { jsx as l } from "react/jsx-runtime";
7
+ //#region src/charts/rules.tsx
8
+ var u = /* @__PURE__ */ new Map([
9
+ ["cursor", e],
10
+ ["grid", t],
11
+ ["hairline", i],
12
+ ["plain", ""],
13
+ ["rule", "rule"],
14
+ ["target", r]
15
+ ]), d = ({ className: e, kind: t = "hairline", x0: n, x1: r, y: i, ...s }) => /* @__PURE__ */ l("line", {
16
+ className: a(u.get(t), e),
17
+ x1: n,
18
+ x2: r,
19
+ y1: o(i),
20
+ y2: o(i),
21
+ ...s
22
+ }), f = ({ className: e, kind: t = "hairline", x: n, y0: r, y1: i, ...s }) => /* @__PURE__ */ l("line", {
23
+ className: a(u.get(t), e),
24
+ x1: o(n),
25
+ x2: o(n),
26
+ y1: r,
27
+ y2: i,
28
+ ...s
29
+ }), p = ({ className: e, hero: t = !1, x: n, y0: r, y1: i, ...c }) => {
30
+ let u = t ? Math.round(n) : o(n);
31
+ return /* @__PURE__ */ l("line", {
32
+ className: a("shape-crisp", e),
33
+ strokeWidth: t ? s.hero : s.rest,
34
+ x1: u,
35
+ x2: u,
36
+ y1: r,
37
+ y2: i,
38
+ ...c
39
+ });
40
+ }, m = ({ className: e, rise: t = !1, size: n = "md", x: r, y: i, ...s }) => /* @__PURE__ */ l("line", {
41
+ className: a("hairline", e),
42
+ x1: o(r),
43
+ x2: o(r),
44
+ y1: i,
45
+ y2: t ? i - c[n] : i + c[n],
46
+ ...s
47
+ }), h = (e) => /* @__PURE__ */ l("g", { children: e.ys.map((t) => /* @__PURE__ */ l("line", {
48
+ className: e.className ?? "grid-line",
49
+ x1: e.x0,
50
+ x2: e.x1,
51
+ y1: o(t),
52
+ y2: o(t)
53
+ }, `h-${t}`)) }), g = (e) => /* @__PURE__ */ l("g", { children: e.xs.map((t) => /* @__PURE__ */ l("line", {
54
+ className: n,
55
+ x1: o(t),
56
+ x2: o(t),
57
+ y1: e.y0,
58
+ y2: e.y1
59
+ }, `v-${t}`)) }), _ = (e) => /* @__PURE__ */ l(f, {
60
+ kind: "cursor",
61
+ x: e.x,
62
+ y0: e.y0,
63
+ y1: e.y1
64
+ });
65
+ //#endregion
66
+ export { _ as Cursor, h as HGrid, d as HRule, p as Stem, m as Tick, g as VGrid, f as VRule };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { createContext as e } from "react";
3
+ //#region src/charts/scale-context.ts
4
+ var t = e({});
5
+ //#endregion
6
+ export { t as ScaleContext };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ var e = (e, t, n, r, i) => {
3
+ if (n <= 0 || r <= 0) return "";
4
+ let a = Math.min(2, n / 2, r / 2);
5
+ return i === "up" ? `M${e},${t + r}V${t + a}A${a},${a} 0 0 1 ${e + a},${t}H${e + n - a}A${a},${a} 0 0 1 ${e + n},${t + a}V${t + r}Z` : i === "down" ? `M${e},${t}V${t + r - a}A${a},${a} 0 0 0 ${e + a},${t + r}H${e + n - a}A${a},${a} 0 0 0 ${e + n},${t + r - a}V${t}Z` : i === "right" ? `M${e},${t}H${e + n - a}A${a},${a} 0 0 1 ${e + n},${t + a}V${t + r - a}A${a},${a} 0 0 1 ${e + n - a},${t + r}H${e}Z` : `M${e + n},${t}H${e + a}A${a},${a} 0 0 0 ${e},${t + a}V${t + r - a}A${a},${a} 0 0 0 ${e + a},${t + r}H${e + n}Z`;
6
+ };
7
+ //#endregion
8
+ export { e as barPath };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { IdScope as e } from "./hooks.js";
3
+ import { DataTable as t } from "./data-table.js";
4
+ import { Fragment as n, createElement as r } from "react";
5
+ //#region src/charts/shared-options.ts
6
+ var i = (e) => ({
7
+ animate: e.animate,
8
+ onReady: e.onReady,
9
+ replayKey: e.replayKey,
10
+ scaling: {
11
+ fit: e.fit,
12
+ scale: e.scale,
13
+ strokes: e.strokes
14
+ }
15
+ }), a = (t, i) => t === void 0 ? r(n, null, i) : r(e, { prefix: t }, i), o = (e, n, i, a) => r(t, {
16
+ caption: n,
17
+ columns: i,
18
+ rows: a,
19
+ visible: e.table
20
+ }), s = (e, t) => {
21
+ let n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left;
22
+ return n.width > 0 ? r * (t / n.width) : r;
23
+ };
24
+ //#endregion
25
+ export { o as chartTable, i as plotOptions, s as pointerX, a as scoped };
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { useSvgId as e } from "./hooks.js";
3
+ import { ScaleContext as t } from "./scale-context.js";
4
+ import { useContext as n } from "react";
5
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
+ //#region src/charts/svg.tsx
7
+ var a = ({ children: a, desc: o, height: s, label: c, leave: l, style: u, title: d, width: f, ...p }) => {
8
+ let m = e("desc"), { fit: h, scale: g, strokes: _ } = n(t), v = h === !0 || g !== void 0, y = _ ?? (v ? "device" : "proportional"), b = v ? {
9
+ height: h === !0 ? void 0 : s * (g ?? 1),
10
+ style: h === !0 ? {
11
+ ...u,
12
+ aspectRatio: `${f} / ${s}`
13
+ } : u,
14
+ viewBox: `0 0 ${f} ${s}`,
15
+ width: h === !0 ? "100%" : f * (g ?? 1)
16
+ } : {
17
+ height: s,
18
+ style: u,
19
+ viewBox: void 0,
20
+ width: f
21
+ };
22
+ return /* @__PURE__ */ i("svg", {
23
+ "data-hl-strokes": y === "device" ? "device" : void 0,
24
+ ...b,
25
+ "aria-describedby": o === void 0 ? void 0 : m,
26
+ "aria-label": c,
27
+ onPointerLeave: l === void 0 ? void 0 : () => {
28
+ l();
29
+ },
30
+ role: "img",
31
+ ...p,
32
+ children: [
33
+ /* @__PURE__ */ r("title", { children: d ?? c }),
34
+ o === void 0 ? null : /* @__PURE__ */ r("desc", {
35
+ id: m,
36
+ children: o
37
+ }),
38
+ a
39
+ ]
40
+ });
41
+ };
42
+ //#endregion
43
+ export { a as ChartSvg };
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { cx as e, stagger as t } from "./util.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/charts/text.tsx
5
+ var r = /* @__PURE__ */ new Map([
6
+ ["axis", "t-axis"],
7
+ ["figure", "t-figure"],
8
+ ["label", "t-label"],
9
+ ["value", "t-value"]
10
+ ]), i = "0.34em", a = ({ anchor: a, className: o, halo: s = !1, middle: c = !1, muted: l = !1, order: u, style: d, tier: f, voice: p, ...m }) => /* @__PURE__ */ n("text", {
11
+ className: e(u === void 0 ? null : "fade", r.get(p), s && "t-halo", l && "fill-muted", o),
12
+ dy: c ? i : void 0,
13
+ style: u === void 0 ? d : {
14
+ ...t(u, f),
15
+ ...d
16
+ },
17
+ textAnchor: a,
18
+ ...m
19
+ }), o = (e) => /* @__PURE__ */ n("g", {
20
+ className: e.className,
21
+ children: e.ticks.map((t, r) => /* @__PURE__ */ n(a, {
22
+ anchor: e.flush === !0 && r === 0 ? "start" : "middle",
23
+ voice: "axis",
24
+ x: t.x,
25
+ y: e.y,
26
+ children: t.label
27
+ }, t.label))
28
+ });
29
+ //#endregion
30
+ export { a as Label, o as XLabels };
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { useSvgId as e } from "./hooks.js";
3
+ //#region src/charts/texture-ids.ts
4
+ var t = {
5
+ cross: 6,
6
+ dense: 3,
7
+ hatch: 4,
8
+ screen: 4
9
+ }, n = [
10
+ .75,
11
+ 1,
12
+ 1.3,
13
+ 1.6,
14
+ 1.85
15
+ ], r = (e) => `url(#${e})`, i = (t) => {
16
+ let n = e(t);
17
+ return (e) => `${n}-${e}`;
18
+ };
19
+ //#endregion
20
+ export { n as HALFTONE_R, t as TEXTURE_PITCH, r as paint, i as useTextureIds };
@@ -0,0 +1,286 @@
1
+ "use client";
2
+ import { sansWidth as e } from "./util.js";
3
+ import { TEXTURE_PITCH as t } from "./texture-ids.js";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ //#region src/charts/texture.tsx
6
+ var i = (e) => /* @__PURE__ */ n("rect", {
7
+ className: e.className ?? "fill-paper",
8
+ height: e.h,
9
+ width: e.w
10
+ }), a = (e, t, n) => Array.from({ length: e }, (r, i) => ({
11
+ x: i,
12
+ y: ((t ? i : e - 1 - i) + n) % e
13
+ })), o = (e) => /* @__PURE__ */ n("g", {
14
+ className: e.tone,
15
+ children: e.cells.map((t) => /* @__PURE__ */ n("rect", {
16
+ height: 1,
17
+ width: 1,
18
+ x: t.x,
19
+ y: t.y
20
+ }, `${e.name}-${t.x}-${t.y}`))
21
+ }), s = ({ angle: e = "rising", ground: s, id: c, pitch: l = t.hatch, tone: u }) => /* @__PURE__ */ r("pattern", {
22
+ height: l,
23
+ id: c,
24
+ patternUnits: "userSpaceOnUse",
25
+ width: l,
26
+ children: [/* @__PURE__ */ n(i, {
27
+ className: s,
28
+ h: l,
29
+ w: l
30
+ }), /* @__PURE__ */ n(o, {
31
+ cells: a(l, e === "falling", 0),
32
+ name: c,
33
+ tone: u
34
+ })]
35
+ }), c = ({ ground: e, id: s, pitch: c = t.cross, tone: l }) => {
36
+ let u = a(c, !1, 0), d = a(c, !0, Math.floor(c / 2)).filter((e) => !u.some((t) => t.x === e.x && t.y === e.y));
37
+ return /* @__PURE__ */ r("pattern", {
38
+ height: c,
39
+ id: s,
40
+ patternUnits: "userSpaceOnUse",
41
+ width: c,
42
+ children: [/* @__PURE__ */ n(i, {
43
+ className: e,
44
+ h: c,
45
+ w: c
46
+ }), /* @__PURE__ */ n(o, {
47
+ cells: [...u, ...d],
48
+ name: s,
49
+ tone: l
50
+ })]
51
+ });
52
+ }, l = ({ angle: e = "level", ground: a, id: o, pitch: s = t.dense, tone: c }) => /* @__PURE__ */ r("pattern", {
53
+ height: s,
54
+ id: o,
55
+ patternUnits: "userSpaceOnUse",
56
+ width: s,
57
+ children: [/* @__PURE__ */ n(i, {
58
+ className: a,
59
+ h: s,
60
+ w: s
61
+ }), /* @__PURE__ */ n("rect", {
62
+ className: c,
63
+ height: e === "level" ? 1 : s,
64
+ width: e === "level" ? s : 1
65
+ })]
66
+ }), u = ({ ground: e, id: a, pitch: o = t.screen, tone: s }) => /* @__PURE__ */ r("pattern", {
67
+ height: o * 2,
68
+ id: a,
69
+ patternUnits: "userSpaceOnUse",
70
+ width: o,
71
+ children: [
72
+ /* @__PURE__ */ n(i, {
73
+ className: e,
74
+ h: o * 2,
75
+ w: o
76
+ }),
77
+ /* @__PURE__ */ n("rect", {
78
+ className: s,
79
+ height: 1,
80
+ width: 1,
81
+ x: 0,
82
+ y: 0
83
+ }),
84
+ /* @__PURE__ */ n("rect", {
85
+ className: s,
86
+ height: 1,
87
+ width: 1,
88
+ x: Math.floor(o / 2),
89
+ y: o
90
+ })
91
+ ]
92
+ }), d = [
93
+ -1,
94
+ 0,
95
+ 1
96
+ ].flatMap((e) => [
97
+ -1,
98
+ 0,
99
+ 1
100
+ ].map((t) => ({
101
+ dx: e,
102
+ dy: t,
103
+ key: `${e}${t}`
104
+ }))), f = ({ ground: e, id: a, pitch: o = t.screen, r: s, tone: c }) => {
105
+ let l = Math.floor(o / 2) + .5, u = s > Math.min(l, o - l) ? d : [{
106
+ dx: 0,
107
+ dy: 0,
108
+ key: "00"
109
+ }];
110
+ return /* @__PURE__ */ r("pattern", {
111
+ height: o,
112
+ id: a,
113
+ patternUnits: "userSpaceOnUse",
114
+ width: o,
115
+ children: [/* @__PURE__ */ n(i, {
116
+ className: e,
117
+ h: o,
118
+ w: o
119
+ }), /* @__PURE__ */ n("g", {
120
+ className: c,
121
+ children: u.map((e) => /* @__PURE__ */ n("circle", {
122
+ cx: l + e.dx * o,
123
+ cy: l + e.dy * o,
124
+ r: s
125
+ }, e.key))
126
+ })]
127
+ });
128
+ }, p = ({ ground: e, id: a, pitch: o = t.dense, tone: s }) => /* @__PURE__ */ r("pattern", {
129
+ height: 1,
130
+ id: a,
131
+ patternUnits: "userSpaceOnUse",
132
+ width: o,
133
+ children: [e === void 0 ? null : /* @__PURE__ */ n(i, {
134
+ className: e,
135
+ h: 1,
136
+ w: o
137
+ }), /* @__PURE__ */ n("rect", {
138
+ className: s,
139
+ height: 1,
140
+ width: 1
141
+ })]
142
+ }), m = ({ className: e, pitch: r = t.dense, tone: i, x0: a, x1: o, y0: s, y1: c }) => {
143
+ let l = Math.round(a) === Math.round(o), u = Math.round(l ? Math.min(s, c) : Math.min(a, o)), d = Math.round(l ? Math.max(s, c) : Math.max(a, o)), f = Math.round(l ? a : s), p = Math.max(0, Math.floor((d - u) / r));
144
+ return /* @__PURE__ */ n("g", {
145
+ className: `${e ?? ""} ${i}`,
146
+ children: Array.from({ length: p + 1 }, (e, t) => {
147
+ let i = u + t * r;
148
+ return /* @__PURE__ */ n("rect", {
149
+ height: 1,
150
+ width: 1,
151
+ x: l ? f : i,
152
+ y: l ? i : f
153
+ }, `dot-${f}-${i}`);
154
+ })
155
+ });
156
+ }, h = 2 * Math.PI, g = ({ className: e, cx: r, cy: i, from: a = 0, r: o, step: s = t.screen, to: c, tone: l }) => {
157
+ let u = c === void 0, d = c ?? a + h, f = Math.max(1, Math.round((d - a) * o / s)), p = u ? f : f + 1;
158
+ return /* @__PURE__ */ n("g", {
159
+ className: `${e ?? ""} ${l}`,
160
+ children: Array.from({ length: p }, (e, t) => {
161
+ let s = a + (d - a) * t / f;
162
+ return /* @__PURE__ */ n("circle", {
163
+ cx: r + o * Math.sin(s),
164
+ cy: i - o * Math.cos(s),
165
+ r: .75
166
+ }, `ring-${o}-${t}`);
167
+ })
168
+ });
169
+ }, _ = (e, t) => {
170
+ let n = [], r = 0;
171
+ for (let [i, a] of e.entries()) {
172
+ let o = e[i - 1], s = o === void 0 ? 0 : Math.hypot(a.x - o.x, a.y - o.y);
173
+ if (o !== void 0 && s > 0) {
174
+ for (; r <= s;) {
175
+ let e = r / s;
176
+ n.push({
177
+ x: o.x + (a.x - o.x) * e,
178
+ y: o.y + (a.y - o.y) * e
179
+ }), r += t;
180
+ }
181
+ r -= s;
182
+ }
183
+ }
184
+ return n;
185
+ }, v = ({ className: e, pitch: r = t.dense, points: i, tone: a }) => /* @__PURE__ */ n("g", {
186
+ className: `${e ?? ""} ${a}`,
187
+ children: _(i, r).map((e) => /* @__PURE__ */ n("circle", {
188
+ cx: e.x,
189
+ cy: e.y,
190
+ r: .75
191
+ }, `path-${e.x.toFixed(2)}-${e.y.toFixed(2)}`))
192
+ }), y = (e, t, n, r) => {
193
+ let i = Math.max(1, Math.round(Math.max(Math.abs(n - e), Math.abs(r - t)))), a = /* @__PURE__ */ new Set(), o = [];
194
+ for (let s = 0; s <= i; s += 1) {
195
+ let c = Math.floor(e + (n - e) * s / i), l = Math.floor(t + (r - t) * s / i), u = `${c},${l}`;
196
+ a.has(u) || (a.add(u), o.push({
197
+ x: c,
198
+ y: l
199
+ }));
200
+ }
201
+ return o;
202
+ }, b = (e) => /* @__PURE__ */ n("g", {
203
+ className: `${e.className ?? ""} ${e.tone}`,
204
+ children: y(e.x0, e.y0, e.x1, e.y1).map((e) => /* @__PURE__ */ n("rect", {
205
+ height: 1,
206
+ width: 1,
207
+ x: e.x,
208
+ y: e.y
209
+ }, `px-${e.x}-${e.y}`))
210
+ }), x = (e) => /* @__PURE__ */ n("g", {
211
+ transform: `translate(${Math.round(e.x)} ${Math.round(e.y)})`,
212
+ children: /* @__PURE__ */ n("rect", {
213
+ className: `${e.tone ?? ""} stroke-l5 shape-crisp`,
214
+ fill: e.fill,
215
+ height: 11,
216
+ rx: 2,
217
+ strokeWidth: 1,
218
+ width: 11,
219
+ x: .5,
220
+ y: .5
221
+ })
222
+ }), S = (e) => {
223
+ let t = e.lead?.x ?? 0, i = e.lead?.y ?? 0, a = Math.max(0, Math.round(e.width) - 1), o = Math.max(0, Math.round(e.height) - 1), s = {
224
+ height: o,
225
+ strokeWidth: 1,
226
+ width: a,
227
+ x: t - .5,
228
+ y: i - .5
229
+ }, c = `translate(${Math.round(e.x) + 1 - t} ${Math.round(e.y) + 1 - i})`;
230
+ if (e.whole === void 0) return /* @__PURE__ */ n("g", {
231
+ transform: c,
232
+ children: /* @__PURE__ */ n("rect", {
233
+ ...s,
234
+ className: `shape-crisp ${e.className ?? "stroke-l5"}`,
235
+ fill: e.fill,
236
+ onPointerEnter: e.onPointerEnter,
237
+ style: e.style
238
+ })
239
+ });
240
+ let { clear: l, pitch: u } = e.whole, d = Math.floor((t + a - 1 - l) / u) * u;
241
+ return /* @__PURE__ */ n("g", {
242
+ transform: c,
243
+ children: /* @__PURE__ */ r("g", {
244
+ className: e.className ?? "stroke-l5",
245
+ onPointerEnter: e.onPointerEnter,
246
+ style: e.style,
247
+ children: [/* @__PURE__ */ n("rect", {
248
+ ...s,
249
+ className: "fill-paper shape-crisp"
250
+ }), /* @__PURE__ */ n("rect", {
251
+ fill: e.fill,
252
+ height: Math.max(0, o - 1),
253
+ stroke: "none",
254
+ width: Math.max(0, d - t),
255
+ x: t,
256
+ y: i
257
+ })]
258
+ })
259
+ });
260
+ }, C = 15, w = ({ anchor: t = "middle", className: i = "t-value", hero: a = !1, lead: o, text: s, x: c, y: l }) => {
261
+ let u = o === void 0 ? s : `${o} ${s}`, d = Math.ceil(e(u, 11)) + 8, f = {
262
+ end: d,
263
+ middle: d / 2,
264
+ start: 0
265
+ }[t], p = Math.round(c - f), m = Math.round(l - C / 2);
266
+ return /* @__PURE__ */ r("g", { children: [/* @__PURE__ */ n("rect", {
267
+ className: a ? "fill-hero" : "fill-paper",
268
+ height: C,
269
+ rx: 2,
270
+ width: d,
271
+ x: p,
272
+ y: m
273
+ }), /* @__PURE__ */ r("text", {
274
+ className: `${i} ${a ? "fill-paper" : ""}`,
275
+ dy: "0.35em",
276
+ textAnchor: "middle",
277
+ x: p + d / 2,
278
+ y: m + C / 2,
279
+ children: [o === void 0 ? null : /* @__PURE__ */ n("tspan", {
280
+ className: a ? "" : "t-axis",
281
+ children: `${o} `
282
+ }), s]
283
+ })] });
284
+ };
285
+ //#endregion
286
+ export { p as Beads, c as CrossHatch, g as DotRing, f as DotScreen, m as DottedLine, v as DottedPath, S as EngravedRect, s as Hatch, x as KeySwatch, b as PixelLine, w as PlateLabel, l as Rules, u as Stipple };
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { INTER_METRICS as e, textWidth as t } from "../schema/metrics.js";
3
+ //#region src/charts/util.ts
4
+ var n = (...e) => e.filter((e) => e !== !1 && e != null && e !== "").join(" "), r = (e, t, n) => Math.max(t, Math.min(n, e)), i = (e) => {
5
+ let t = 0;
6
+ for (let n of e) t += n;
7
+ return t;
8
+ }, a = (e, t = "centred") => e.map((n, a) => {
9
+ let o = r(t === "centred" ? a - 3 : a - 6, 0, Math.max(0, e.length - 7)), s = e.slice(o, o + 7);
10
+ return i(s) / s.length;
11
+ }), o = (e) => e !== void 0 && e !== "", s = (e, t) => t === void 0 ? { "--hl-i": e } : {
12
+ "--hl-i": e,
13
+ "--hl-stagger": `var(--hl-stagger-${t})`
14
+ }, c = (e) => e ? "opacity-30 transition-opacity" : "transition-opacity", l = (e, t = !1) => {
15
+ let n = e.map((e, t) => ({
16
+ i: t,
17
+ v: e
18
+ })).toSorted((e, n) => t ? e.v - n.v : n.v - e.v), r = e.map(() => 0);
19
+ for (let [e, t] of n.entries()) r[t.i] = e;
20
+ return r;
21
+ }, u = (n, r = 11, i = e) => t(n, r, i), d = 11, f = (e, t, n) => {
22
+ if (!o(e)) return [];
23
+ let r = e.split(" · ");
24
+ if (r.some((e) => u(e, d, n) > t)) return [];
25
+ let i = [];
26
+ for (let e of r) {
27
+ let r = i.at(-1);
28
+ r !== void 0 && u(`${r} · ${e}`, d, n) <= t ? i[i.length - 1] = `${r} · ${e}` : i.push(e);
29
+ }
30
+ return i;
31
+ }, p = (e, t, n, r) => {
32
+ let i = f(e, t, r).length;
33
+ return i === 0 ? 0 : n + (i - 1) * 12;
34
+ }, m = (e, t, n) => {
35
+ let r = [];
36
+ for (let i of e.split(" ")) {
37
+ let e = r.at(-1);
38
+ e !== void 0 && n(`${e} ${i}`) <= t ? r[r.length - 1] = `${e} ${i}` : r.push(i);
39
+ }
40
+ return r;
41
+ }, h = (e) => e.unitNote ?? e.note, g = 500, _ = (e, t) => Math.max(e, t / g);
42
+ //#endregion
43
+ export { r as clamp, _ as countingUnit, n as cx, c as dimClass, o as hasText, f as noteLines, h as noteOf, p as noteSpace, l as ranks, u as sansWidth, s as stagger, i as sum, a as weeklyMean, m as wrapWords };
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { crisp as e } from "./axes.js";
3
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
+ //#region src/charts/value-grid.tsx
5
+ var r = 4, i = (i) => {
6
+ let a = i.side === "right";
7
+ return /* @__PURE__ */ t("g", { children: i.ticks.flatMap((o) => {
8
+ let s = i.y(o), c = s < i.floor - 1;
9
+ return !c && i.labelFloor !== !0 ? [] : /* @__PURE__ */ n("g", { children: [c ? /* @__PURE__ */ t("line", {
10
+ className: "grid-line",
11
+ x1: Math.round(i.x0),
12
+ x2: Math.round(i.x1),
13
+ y1: e(s),
14
+ y2: e(s)
15
+ }) : null, /* @__PURE__ */ t("text", {
16
+ className: "t-axis",
17
+ dy: a ? void 0 : "0.34em",
18
+ textAnchor: "end",
19
+ x: a ? Math.round(i.x1) : i.x0 - 8,
20
+ y: a ? Math.round(s) - r : s,
21
+ children: i.format(o)
22
+ })] }, o);
23
+ }) });
24
+ };
25
+ //#endregion
26
+ export { i as ValueGrid };
package/lib/draw.js ADDED
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { DumbbellQueue as e } from "./charts/basics/dumbbell-queue.js";
3
+ import { HairlineArea as t } from "./charts/basics/hairline-area.js";
4
+ import { HairlineLine as n } from "./charts/basics/hairline-line.js";
5
+ import { PlumbScatter as r } from "./charts/basics/plumb-scatter.js";
6
+ import { RungBars as i } from "./charts/basics/rung-bars.js";
7
+ import { Slope as a } from "./charts/board/slope.js";
8
+ import { charts as o } from "./schema/registry.js";
9
+ import { createElement as s } from "react";
10
+ //#region src/draw.ts
11
+ var c = (e, t) => function(n, r = {}) {
12
+ let i = e.validate(n);
13
+ if (!i.ok) throw Error(`${e.kind}: ${i.issues.map((e) => `${e.pointer} ${e.message}`).join("; ")}`);
14
+ return s(t, {
15
+ ...i.value,
16
+ ...r
17
+ });
18
+ }, l = {
19
+ "dumbbell-queue": c(o["dumbbell-queue"], e),
20
+ "hairline-area": c(o["hairline-area"], t),
21
+ "hairline-line": c(o["hairline-line"], n),
22
+ "plumb-scatter": c(o["plumb-scatter"], r),
23
+ "rung-bars": c(o["rung-bars"], i),
24
+ slope: c(o.slope, a)
25
+ };
26
+ //#endregion
27
+ export { l as drawers };
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { DumbbellQueue } from "../charts/basics/dumbbell-queue.js";
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { HairlineArea } from "../charts/basics/hairline-area.js";
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { HairlineLine } from "../charts/basics/hairline-line.js";
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { PlumbScatter } from "../charts/basics/plumb-scatter.js";
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { RungBars } from "../charts/basics/rung-bars.js";
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { Slope } from "../charts/board/slope.js";
package/lib/frame.js ADDED
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { Frame } from "./charts/frame.js";