@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,210 @@
1
+ "use client";
2
+ import { useHover as e } from "../hooks.js";
3
+ import { Plot as t, Tooltip as n } from "../core.js";
4
+ import { noteLines as r, noteOf as i, ranks as a, sansWidth as o, stagger as s, wrapWords as c } from "../util.js";
5
+ import { DimGroup as l, HitPath as u, TipText as d } from "../hover.js";
6
+ import { RING_STEP as f } from "../marks.js";
7
+ import { FootNote as p } from "../plot-note.js";
8
+ import { ChartSvg as m } from "../svg.js";
9
+ import { Label as h } from "../text.js";
10
+ import { inkWidth as g } from "./util-b.js";
11
+ import { DotRing as _ } from "../texture.js";
12
+ import { tickDonutDemo as v } from "./tick-donut.data.js";
13
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
14
+ import { arc as x } from "d3-shape";
15
+ //#region src/charts/basics/tick-donut.tsx
16
+ var S = 100, C = 6, w = [
17
+ "stroke-l3",
18
+ "stroke-l4",
19
+ "stroke-l5",
20
+ "stroke-l6"
21
+ ], T = (e) => o(e, 12), E = (e) => {
22
+ let t = e.reduce((e, t) => e + t, 0), n = e.map((e) => t > 0 ? e / t * S : 0), r = n.map((e) => Math.floor(e)), i = S - r.reduce((e, t) => e + t, 0), a = n.map((e, t) => ({
23
+ i: t,
24
+ rem: e - Math.floor(e)
25
+ })).toSorted((e, t) => t.rem - e.rem);
26
+ for (let { i: e } of a) {
27
+ if (i <= 0) break;
28
+ r[e] += 1, --i;
29
+ }
30
+ return r;
31
+ }, D = (e, t, n) => {
32
+ let r = (t - 90) * Math.PI / 180;
33
+ return {
34
+ x: e.cx + n * Math.cos(r),
35
+ y: e.cy + n * Math.sin(r)
36
+ };
37
+ }, O = (e) => e / S * 360, k = 14, A = 14, j = 4, M = (e, t) => {
38
+ let n = Math.sin(e * Math.PI / 180), r = Math.cos(e * Math.PI / 180), i = (t - 1) * A;
39
+ return n > .25 ? {
40
+ anchor: "start",
41
+ dy: 3.5 - i / 2
42
+ } : n < -.25 ? {
43
+ anchor: "end",
44
+ dy: 3.5 - i / 2
45
+ } : {
46
+ anchor: "middle",
47
+ dy: r > 0 ? -4 - i : 10
48
+ };
49
+ }, N = (e, t, n, r) => {
50
+ let i = Math.sin(n * Math.PI / 180), a = t + (r + k) * i;
51
+ return i > .25 ? e - j - a : i < -.25 ? a - j : 2 * Math.min(a, e - a) - 8;
52
+ }, P = (e, t, n) => {
53
+ let r = e * Math.PI / 180, i = (t - 1) * A;
54
+ return Math.abs(Math.sin(r)) > .25 ? Math.abs(Math.cos(r)) * (n + k) + i / 2 + 12 : n + k + 14 + i;
55
+ }, F = (e, t, n) => {
56
+ let r = Math.abs(Math.sin(t * Math.PI / 180));
57
+ return r > .25 ? (e / 2 - j - n) / r - k : Infinity;
58
+ }, I = (e, t) => {
59
+ let n = `${e.name} · ${e.value}`;
60
+ return T(n) <= t ? [n] : [...c(e.name, t, T), e.value];
61
+ }, L = (e, t, n) => {
62
+ let r = Math.min(...n.map((t) => F(e, t.mid, T(`${t.name} · ${t.value}`)))), i = Math.min(t, Math.max(Math.max(56, t * .85), r)), a = Math.min(...n.map((t) => I(t, N(e, e / 2, t.mid, i)).length === 1 ? Infinity : F(e, t.mid, Math.max(T(t.name), T(t.value)))));
63
+ return Math.max(56, Math.min(i, a));
64
+ }, R = (e, t, n, r) => {
65
+ let i = e - t - 4, a = e + t + 4;
66
+ for (let [o, s] of n.entries()) {
67
+ let n = e + (t + k) * Math.sin(s.mid * Math.PI / 180), c = Math.max(...(r[o] ?? []).map((e) => g(e))), { anchor: l } = M(s.mid, r[o]?.length ?? 1);
68
+ i = Math.min(i, l === "start" ? n : n - (l === "end" ? c : c / 2)), a = Math.max(a, l === "end" ? n : n + (l === "start" ? c : c / 2));
69
+ }
70
+ return [i, a];
71
+ }, z = ({ count: e, datum: t, dial: n, dim: r, hero: i, lines: a, onEnter: o, rank: c, start: d }) => {
72
+ let f = i ? "stroke-hero" : w[Math.max(0, Math.min(c, w.length) - 1)], p = O(d), m = O(d + e), g = (p + m) / 2, _ = D(n, g, n.rOut + k), v = M(g, a.length), S = Math.max(_.y, 11 - v.dy), C = x().innerRadius(n.rIn - 14).outerRadius(n.rOut + 10)({
73
+ endAngle: m * Math.PI / 180,
74
+ startAngle: p * Math.PI / 180
75
+ }) ?? "", T = Array.from({ length: e }, (e, t) => ({
76
+ id: `tick-${d + t}`,
77
+ t: d + t
78
+ })), E = D(n, g, n.rOut);
79
+ return /* @__PURE__ */ b(l, {
80
+ dim: r,
81
+ onPointerEnter: () => {
82
+ o(E.x, E.y - 8);
83
+ },
84
+ children: [
85
+ /* @__PURE__ */ y(u, {
86
+ d: C,
87
+ transform: `translate(${n.cx},${n.cy})`
88
+ }),
89
+ T.map((e) => /* @__PURE__ */ y("g", {
90
+ transform: `rotate(${O(e.t)} ${n.cx} ${n.cy})`,
91
+ children: /* @__PURE__ */ y("line", {
92
+ className: `grow-y ${f}`,
93
+ strokeWidth: 2,
94
+ style: s(e.t, "dense"),
95
+ x1: n.cx,
96
+ x2: n.cx,
97
+ y1: n.cy - n.rIn,
98
+ y2: n.cy - n.rOut - (e.t % 10 == 0 ? 4 : 0)
99
+ })
100
+ }, e.id)),
101
+ /* @__PURE__ */ y(h, {
102
+ anchor: v.anchor,
103
+ muted: !i,
104
+ order: 4 + c,
105
+ voice: "label",
106
+ children: a.map((e, n) => /* @__PURE__ */ y("tspan", {
107
+ dy: n === 0 ? v.dy : A,
108
+ x: _.x,
109
+ y: n === 0 ? S : void 0,
110
+ children: e
111
+ }, `${t.label}-${e}`))
112
+ })
113
+ ]
114
+ });
115
+ }, B = ({ center: e, clear: t, data: n, dim: i, format: o, height: s, highlight: c, note: l, show: u, width: d }) => {
116
+ let g = n.map((e) => e.value), v = E(g), x = a(g), S = r(l, d - 24), w = S.length > 0 ? 18 + S.length * 12 : 0, T = d < 440 ? 72 : 128, D = v.map((e, t) => v.slice(0, t).reduce((e, t) => e + t, 0)), k = n.map((e, t) => ({
117
+ mid: O(D[t] + v[t] / 2),
118
+ name: e.label,
119
+ value: `${v[t]}%`
120
+ })), A = L(d, Math.max(56, Math.min(148, (s - w) / 2 - 40, (d - T * 2) / 2)), k), j = Math.max(12, A * .17), M = (e) => k.map((t) => I(t, N(d, e, t.mid, A))), F = (e, t) => {
121
+ let [n, r] = R(e, A, k, t);
122
+ return e + (d - n - r) / 2;
123
+ }, B = d / 2, V = F(B, M(B)), H = M(V), U = F(V, H), W = Math.max(A + 8, ...k.map((e, t) => P(e.mid, H[t].length, A))), G = Math.min(s - w, Math.ceil(2 * W + 24)), K = {
124
+ cx: U,
125
+ cy: G / 2 + 4,
126
+ rIn: A - j,
127
+ rOut: A,
128
+ tickLen: j
129
+ }, q = `Shares of the whole: ${n.map((e) => `${e.label} ${o(e.value)}`).join(", ")}`;
130
+ return /* @__PURE__ */ b(m, {
131
+ height: G + w,
132
+ label: q,
133
+ leave: t,
134
+ width: d,
135
+ children: [
136
+ /* @__PURE__ */ y(_, {
137
+ className: "fade",
138
+ tone: "fill-l4",
139
+ cx: K.cx,
140
+ cy: K.cy,
141
+ r: K.rIn - C,
142
+ step: f.guide
143
+ }),
144
+ n.map((e, t) => /* @__PURE__ */ y(z, {
145
+ count: v[t],
146
+ datum: e,
147
+ dial: K,
148
+ dim: i(t),
149
+ hero: (c ?? x.indexOf(0)) === t,
150
+ lines: H[t],
151
+ onEnter: (e, n) => {
152
+ u(t, e, n);
153
+ },
154
+ rank: x[t],
155
+ start: D[t]
156
+ }, e.label)),
157
+ /* @__PURE__ */ y(h, {
158
+ anchor: "middle",
159
+ className: "fade",
160
+ voice: "figure",
161
+ x: K.cx,
162
+ y: K.cy + 6,
163
+ children: e.value
164
+ }),
165
+ r(K.rIn < 56 ? "" : e.caption, K.rIn * 1.7).map((e, t) => /* @__PURE__ */ y(h, {
166
+ anchor: "middle",
167
+ className: "fade",
168
+ voice: "axis",
169
+ x: K.cx,
170
+ y: K.cy + 24 + t * 12,
171
+ children: e
172
+ }, e)),
173
+ /* @__PURE__ */ y(p, {
174
+ gutter: 12,
175
+ height: G + w,
176
+ text: l,
177
+ width: d
178
+ })
179
+ ]
180
+ });
181
+ }, V = (r) => {
182
+ let a = r.data ?? v, o = r.format ?? String, s = e(), c = a.reduce((e, t) => e + t.value, 0);
183
+ return /* @__PURE__ */ y(t, {
184
+ overlay: s.at === null ? null : /* @__PURE__ */ y(n, {
185
+ x: s.at.x,
186
+ y: s.at.y,
187
+ children: /* @__PURE__ */ y(d, {
188
+ facts: [o(a[s.at.key].value), ((e) => `${c > 0 ? Math.round(e / c * 100) : 0}%`)(a[s.at.key].value)],
189
+ lead: a[s.at.key].label
190
+ })
191
+ }),
192
+ children: (e) => /* @__PURE__ */ y(B, {
193
+ center: r.center ?? {
194
+ caption: r.unit ?? "total",
195
+ value: o(c)
196
+ },
197
+ clear: s.clear,
198
+ data: a,
199
+ dim: s.dim,
200
+ format: o,
201
+ height: r.height ?? 420,
202
+ highlight: r.highlight,
203
+ note: i(r),
204
+ show: s.show,
205
+ width: e
206
+ })
207
+ });
208
+ };
209
+ //#endregion
210
+ export { V as TickDonut };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ //#region src/charts/basics/tick-gauge.data.ts
3
+ var e = {
4
+ target: 681.4,
5
+ value: 242.6
6
+ };
7
+ //#endregion
8
+ export { e as tickGaugeDemo };
@@ -0,0 +1,169 @@
1
+ "use client";
2
+ import { useHover as e } from "../hooks.js";
3
+ import { Plot as t, Tooltip as n } from "../core.js";
4
+ import { clamp as r, noteOf as i, stagger as a } from "../util.js";
5
+ import { TipText as o } from "../hover.js";
6
+ import { RING_STEP as s } from "../marks.js";
7
+ import { FootNote as c } from "../plot-note.js";
8
+ import { ChartSvg as l } from "../svg.js";
9
+ import { Label as u } from "../text.js";
10
+ import { polar as d } from "./util-b.js";
11
+ import { DotRing as f } from "../texture.js";
12
+ import { tickGaugeDemo as p } from "./tick-gauge.data.js";
13
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
14
+ //#region src/charts/basics/tick-gauge.tsx
15
+ var g = Math.PI / 180, _ = [
16
+ .25,
17
+ .5,
18
+ .75,
19
+ 1
20
+ ], v = (e, t, n, r) => {
21
+ let i = d(e.cx, e.cy, t, n), a = d(e.cx, e.cy, t, r);
22
+ return `M${i.x},${i.y}A${t},${t} 0 ${+(r - n > Math.PI)} 1 ${a.x},${a.y}`;
23
+ }, y = (e, t, n, i, a, o) => {
24
+ let s = o ? 56 : 10, c = Math.max(-Math.cos(n / 2), .2), l = Math.min(e / 2 - 28, Math.max(150, e * .27), (t - 16 - s - 8) / (1 + c)), u = -n / 2, d = n / (i - 1), f = Math.min(t, Math.ceil(16 + s + 8 + l * (1 + c)));
25
+ return {
26
+ a0: u,
27
+ cx: e / 2,
28
+ cy: 16 + (f - 16 - s - l * (1 + c)) / 2 + l,
29
+ earned: a,
30
+ endA: u + Math.max(0, a - 1) * d + d * .9,
31
+ height: f,
32
+ len: r(l * .19, 14, 34),
33
+ n: i,
34
+ radius: l,
35
+ step: d,
36
+ sweep: n
37
+ };
38
+ }, b = (e, t) => e === t.earned - 1 ? "stroke-hero" : e < t.earned ? "stroke-l3" : "stroke-l6", x = 6, S = (e) => {
39
+ let { dial: t } = e, n = t.radius, r = Array.from({ length: t.n }, (e, r) => {
40
+ let i = t.a0 + r * t.step;
41
+ return {
42
+ i: r,
43
+ id: `tick-${r}`,
44
+ inner: d(t.cx, t.cy, n - t.len, i),
45
+ on: r < t.earned,
46
+ outer: d(t.cx, t.cy, n, i)
47
+ };
48
+ });
49
+ return /* @__PURE__ */ m("g", { children: r.map((e) => /* @__PURE__ */ m("line", {
50
+ className: `fade ${b(e.i, t)}`,
51
+ strokeWidth: 2,
52
+ style: a(e.i, "dense"),
53
+ x1: e.inner.x,
54
+ x2: e.outer.x,
55
+ y1: e.inner.y,
56
+ y2: e.outer.y
57
+ }, e.id)) });
58
+ }, C = (e) => {
59
+ let { dial: t } = e;
60
+ return /* @__PURE__ */ m("g", {
61
+ className: "fade",
62
+ style: a(12),
63
+ children: _.map((e) => {
64
+ let n = t.a0 + e * t.sweep, r = d(t.cx, t.cy, t.radius - t.len - 20, n), i = d(t.cx, t.cy, t.radius - t.len - 14, n), a = e === 1;
65
+ return /* @__PURE__ */ m(u, {
66
+ anchor: a ? "end" : "middle",
67
+ middle: !0,
68
+ voice: "axis",
69
+ x: a ? i.x - 4 : r.x,
70
+ y: a ? i.y : r.y,
71
+ children: Math.round(e * t.n)
72
+ }, e);
73
+ })
74
+ });
75
+ }, w = (e) => {
76
+ let { dial: t } = e, n = t.cy + 6;
77
+ return /* @__PURE__ */ h("g", { children: [/* @__PURE__ */ h(u, {
78
+ anchor: "middle",
79
+ className: "fade",
80
+ voice: "figure",
81
+ x: t.cx,
82
+ y: n,
83
+ children: [e.pct, "%"]
84
+ }), /* @__PURE__ */ m(u, {
85
+ anchor: "middle",
86
+ className: "fade",
87
+ voice: "axis",
88
+ x: t.cx,
89
+ y: n + 20,
90
+ children: e.caption
91
+ })] });
92
+ }, T = (e) => {
93
+ let { dial: t } = e, n = t.radius - t.len / 2, r = t.a0 + t.sweep + t.step / 2, i = [{
94
+ a0: t.a0 - t.step / 2,
95
+ a1: t.endA,
96
+ part: "earned",
97
+ show: t.earned > 0
98
+ }, {
99
+ a0: t.endA,
100
+ a1: r,
101
+ part: "left",
102
+ show: t.earned < t.n
103
+ }];
104
+ return /* @__PURE__ */ m("g", { children: i.filter((e) => e.show).map((r) => /* @__PURE__ */ m("path", {
105
+ className: "fill-none stroke-transparent",
106
+ d: v(t, n, r.a0, r.a1),
107
+ onPointerEnter: () => {
108
+ let n = d(t.cx, t.cy, t.radius + 6, (r.a0 + r.a1) / 2);
109
+ e.onHover(r.part, n.x, n.y);
110
+ },
111
+ strokeWidth: t.len + 12
112
+ }, r.part)) });
113
+ }, E = (a) => {
114
+ let u = a.data ?? p, d = a.height ?? 350, _ = a.format ?? String, v = a.ticks ?? 100, b = (a.sweep ?? 240) * g, E = r(u.value / u.target, 0, 1), D = Math.round(E * v), O = a.caption?.(v - D) ?? `${_(Math.max(0, u.target - u.value))} to come`, k = Math.round(E * 100), A = `${k}% of target: ${_(u.value)} of ${_(u.target)}`, j = e(), M = j.key === "earned" ? /* @__PURE__ */ m(o, {
115
+ facts: [`${_(u.value)} of ${_(u.target)}`],
116
+ lead: "Fallen"
117
+ }) : /* @__PURE__ */ m(o, {
118
+ facts: [_(Math.max(0, u.target - u.value))],
119
+ lead: "To come"
120
+ });
121
+ return /* @__PURE__ */ m(t, {
122
+ overlay: j.at === null ? null : /* @__PURE__ */ m(n, {
123
+ x: j.at.x,
124
+ y: j.at.y,
125
+ children: M
126
+ }),
127
+ children: (e) => {
128
+ let t = y(e, d, b, v, D, i(a) !== void 0);
129
+ return /* @__PURE__ */ h(l, {
130
+ height: t.height,
131
+ label: A,
132
+ leave: j.clear,
133
+ width: e,
134
+ children: [
135
+ /* @__PURE__ */ m(S, { dial: t }),
136
+ /* @__PURE__ */ m(f, {
137
+ className: "fade",
138
+ tone: "fill-l4",
139
+ cx: t.cx,
140
+ cy: t.cy,
141
+ from: t.a0,
142
+ r: t.radius - t.len - x,
143
+ step: s.guide,
144
+ to: t.a0 + t.sweep
145
+ }),
146
+ /* @__PURE__ */ m(C, { dial: t }),
147
+ /* @__PURE__ */ m(w, {
148
+ caption: O,
149
+ dial: t,
150
+ pct: k
151
+ }),
152
+ /* @__PURE__ */ m(T, {
153
+ dial: t,
154
+ onHover: (e, t, n) => {
155
+ j.show(e, t, n);
156
+ }
157
+ }),
158
+ /* @__PURE__ */ m(c, {
159
+ height: t.height,
160
+ text: i(a),
161
+ width: e
162
+ })
163
+ ]
164
+ });
165
+ }
166
+ });
167
+ };
168
+ //#endregion
169
+ export { E as TickGauge };
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ //#region src/charts/basics/tick-rows.data.ts
3
+ var e = [
4
+ {
5
+ label: "House sparrow",
6
+ value: 1275378
7
+ },
8
+ {
9
+ label: "Blue tit",
10
+ value: 1114620
11
+ },
12
+ {
13
+ label: "Starling",
14
+ value: 796002
15
+ },
16
+ {
17
+ label: "Woodpigeon",
18
+ value: 787190
19
+ },
20
+ {
21
+ label: "Blackbird",
22
+ value: 598783
23
+ },
24
+ {
25
+ label: "Great tit",
26
+ value: 562690
27
+ }
28
+ ];
29
+ //#endregion
30
+ export { e as tickRowsDemo };
@@ -0,0 +1,121 @@
1
+ "use client";
2
+ import { useHover as e } from "../hooks.js";
3
+ import { Plot as t, Tooltip as n } from "../core.js";
4
+ import { hasText as r, noteLines as i, noteOf as a, stagger as o, wrapWords as s } from "../util.js";
5
+ import { DimGroup as c, HitRect as l, TipText as u } from "../hover.js";
6
+ import { FootNote as d } from "../plot-note.js";
7
+ import { HRule as f } from "../rules.js";
8
+ import { ChartSvg as p } from "../svg.js";
9
+ import { Label as m } from "../text.js";
10
+ import { inkWidth as h, maxIndex as g } from "./util-b.js";
11
+ import { RUNG as _ } from "./rung-geometry.js";
12
+ import { tickRowsDemo as v } from "./tick-rows.data.js";
13
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
14
+ //#region src/charts/basics/tick-rows.tsx
15
+ var x = 14, S = (e) => h(e), C = (e, t) => {
16
+ let n = t < 440 ? 70 : 96, r = Math.max(0, ...e.map((e) => S(e))), i = Math.min(Math.max(n, Math.ceil(r)), Math.max(n, Math.round(t * .34))), a = e.map((e) => S(e) <= i ? [e] : s(e, i, S));
17
+ return {
18
+ labelW: Math.max(...a.flat().map((e) => Math.ceil(S(e)))),
19
+ lines: a
20
+ };
21
+ }, w = 5, T = (e) => e + Math.floor(Math.max(0, e - 1) / w), E = (e, t) => e.x0 + (t + Math.floor(t / w)) * e.pitch, D = ({ datum: e, dim: t, format: n, frame: r, hero: i, index: a, lines: s, onEnter: u, unit: d }) => {
22
+ let p = Math.round(e.value / d), h = Math.round(12 + (a + .5) * r.pitchY + r.tickH / 2), g = h - r.tickH / 2, v = E(r, Math.max(0, p - 1)) + _, S = Array.from({ length: p }, (t, n) => ({
23
+ id: `${e.label}-tick-${n}`,
24
+ k: n
25
+ }));
26
+ return /* @__PURE__ */ b(c, {
27
+ dim: t,
28
+ onPointerEnter: () => {
29
+ u(v, h - r.tickH - 8);
30
+ },
31
+ children: [
32
+ /* @__PURE__ */ y(l, {
33
+ height: r.pitchY,
34
+ width: r.labelW + r.gap + r.track + 40,
35
+ x: r.x0 - r.labelW - r.gap,
36
+ y: g - r.pitchY / 2
37
+ }),
38
+ /* @__PURE__ */ y(f, {
39
+ kind: "rule",
40
+ x0: r.x0 - 3,
41
+ x1: r.x0 + r.track,
42
+ y: h
43
+ }),
44
+ S.map((e) => /* @__PURE__ */ y("rect", {
45
+ className: `grow-y ${i ? "fill-hero" : "fill-l3"}`,
46
+ height: r.tickH,
47
+ style: o(a * 3 + e.k, "fine"),
48
+ width: _,
49
+ x: E(r, e.k),
50
+ y: h - r.tickH
51
+ }, e.id)),
52
+ /* @__PURE__ */ y(m, {
53
+ anchor: "end",
54
+ muted: !0,
55
+ voice: "label",
56
+ y: g - (s.length - 1) * x / 2,
57
+ children: s.map((t, n) => /* @__PURE__ */ y("tspan", {
58
+ dy: n === 0 ? "0.35em" : x,
59
+ x: r.x0 - r.gap,
60
+ children: t
61
+ }, `${e.label}-${t}`))
62
+ }),
63
+ /* @__PURE__ */ y(m, {
64
+ className: i ? "fill-hero" : "",
65
+ dy: "0.35em",
66
+ order: a + 2,
67
+ voice: "value",
68
+ x: v + 12,
69
+ y: g,
70
+ children: n(e.value)
71
+ })
72
+ ]
73
+ });
74
+ }, O = (o) => {
75
+ let s = o.data ?? v, c = o.unit ?? 1, l = o.format ?? String, f = r(a(o)), m = o.height ?? s.length * 66 + (f ? 56 : 24), _ = e(), x = s.map((e) => `${e.label} ${l(e.value)}`).join(", ");
76
+ return /* @__PURE__ */ y(t, {
77
+ overlay: _.at === null ? null : /* @__PURE__ */ y(n, {
78
+ x: _.at.x,
79
+ y: _.at.y,
80
+ children: /* @__PURE__ */ y(u, {
81
+ facts: [l(s[_.at.key].value)],
82
+ lead: s[_.at.key].label
83
+ })
84
+ }),
85
+ children: (e) => {
86
+ let { labelW: t, lines: n } = C(s.map((e) => e.label), e), r = e < 440 ? 12 : 22, u = T(Math.max(...s.map((e) => Math.round(e.value / c)))), v = Math.max(...s.map((e) => Math.ceil(h(l(e.value))))), S = Math.max(4, Math.min(9, Math.floor((e - 4 - t - r - 12 - v - 2) / Math.max(1, u - 1)))), w = (u - 1) * S + 2, E = u * S, O = i(a(o), e - 24), k = m + Math.max(0, O.length - 1) * 12, A = (m - (f ? 56 : 24)) / s.length, j = {
87
+ gap: r,
88
+ labelW: t,
89
+ pitch: S,
90
+ pitchY: A,
91
+ tickH: Math.round(Math.min(20, A * .3)),
92
+ track: E,
93
+ x0: Math.round((e - (t + r + w + 12 + v)) / 2 + t + r)
94
+ }, M = o.highlight ?? g(s.map((e) => e.value));
95
+ return /* @__PURE__ */ b(p, {
96
+ height: k,
97
+ label: x,
98
+ leave: _.clear,
99
+ width: e,
100
+ children: [s.map((e, t) => /* @__PURE__ */ y(D, {
101
+ datum: e,
102
+ dim: _.dim(t),
103
+ format: l,
104
+ frame: j,
105
+ hero: M === t,
106
+ index: t,
107
+ lines: n[t],
108
+ onEnter: _.showAt(t),
109
+ unit: c
110
+ }, e.label)), /* @__PURE__ */ y(d, {
111
+ gutter: 12,
112
+ height: k,
113
+ text: a(o),
114
+ width: e
115
+ })]
116
+ });
117
+ }
118
+ });
119
+ };
120
+ //#endregion
121
+ export { O as TickRows };
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { noteLines as e } from "../util.js";
3
+ import { utcFormat as t } from "d3-time-format";
4
+ //#region src/charts/basics/util-a.ts
5
+ var n = (e) => e.getUTCDay() === 0 || e.getUTCDay() === 6;
6
+ t("%-d %b");
7
+ var r = (e, t) => {
8
+ let n = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
9
+ return n.setUTCDate(n.getUTCDate() + t), n;
10
+ }, i = (t, n, r, i) => {
11
+ let a = e(n, r - 24, i);
12
+ return Math.round(t - (a.length > 0 ? 56 : 34) - Math.max(0, a.length - 1) * 12);
13
+ };
14
+ //#endregion
15
+ export { i as dailyFloor, r as dayAfter, n as isWeekend };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { sansWidth as e } from "../util.js";
3
+ //#region src/charts/basics/util-b.ts
4
+ var t = (e, t, n, r) => ({
5
+ x: e + n * Math.sin(r),
6
+ y: t - n * Math.cos(r)
7
+ }), n = (e) => {
8
+ let t = 0;
9
+ for (let [n, r] of e.entries()) r > (e[t] ?? -Infinity) && (t = n);
10
+ return t;
11
+ }, r = (t, n) => (t.match(/\d/gu) ?? []).length * .65 * 11 + e(t.replaceAll(/\d/gu, ""), 11, n) * .93;
12
+ //#endregion
13
+ export { r as inkWidth, n as maxIndex, t as polar };