@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,146 @@
1
+ "use client";
2
+ //#region src/charts/glance/circular-graph.data.ts
3
+ var e = {
4
+ links: [
5
+ {
6
+ source: "London",
7
+ target: "South East",
8
+ value: 243
9
+ },
10
+ {
11
+ source: "East",
12
+ target: "London",
13
+ value: 155
14
+ },
15
+ {
16
+ source: "South East",
17
+ target: "South West",
18
+ value: 108
19
+ },
20
+ {
21
+ source: "East",
22
+ target: "South East",
23
+ value: 78
24
+ },
25
+ {
26
+ source: "London",
27
+ target: "South West",
28
+ value: 66
29
+ },
30
+ {
31
+ source: "North West",
32
+ target: "Yorkshire",
33
+ value: 65
34
+ },
35
+ {
36
+ source: "East Midlands",
37
+ target: "West Midlands",
38
+ value: 59
39
+ },
40
+ {
41
+ source: "London",
42
+ target: "West Midlands",
43
+ value: 55
44
+ },
45
+ {
46
+ source: "East",
47
+ target: "East Midlands",
48
+ value: 53
49
+ },
50
+ {
51
+ source: "East Midlands",
52
+ target: "Yorkshire",
53
+ value: 53
54
+ },
55
+ {
56
+ source: "East Midlands",
57
+ target: "London",
58
+ value: 50
59
+ },
60
+ {
61
+ source: "East Midlands",
62
+ target: "South East",
63
+ value: 49
64
+ },
65
+ {
66
+ source: "London",
67
+ target: "North West",
68
+ value: 49
69
+ },
70
+ {
71
+ source: "North West",
72
+ target: "West Midlands",
73
+ value: 48
74
+ },
75
+ {
76
+ source: "South East",
77
+ target: "West Midlands",
78
+ value: 44
79
+ },
80
+ {
81
+ source: "South West",
82
+ target: "West Midlands",
83
+ value: 39
84
+ },
85
+ {
86
+ source: "London",
87
+ target: "Yorkshire",
88
+ value: 38
89
+ },
90
+ {
91
+ source: "North West",
92
+ target: "South East",
93
+ value: 35
94
+ },
95
+ {
96
+ source: "East Midlands",
97
+ target: "North West",
98
+ value: 34
99
+ },
100
+ {
101
+ source: "North East",
102
+ target: "Yorkshire",
103
+ value: 34
104
+ }
105
+ ],
106
+ nodes: [
107
+ {
108
+ id: "North East",
109
+ value: 133
110
+ },
111
+ {
112
+ id: "North West",
113
+ value: 342
114
+ },
115
+ {
116
+ id: "Yorkshire",
117
+ value: 303
118
+ },
119
+ {
120
+ id: "East Midlands",
121
+ value: 344
122
+ },
123
+ {
124
+ id: "West Midlands",
125
+ value: 332
126
+ },
127
+ {
128
+ id: "East",
129
+ value: 419
130
+ },
131
+ {
132
+ id: "London",
133
+ value: 709
134
+ },
135
+ {
136
+ id: "South East",
137
+ value: 636
138
+ },
139
+ {
140
+ id: "South West",
141
+ value: 357
142
+ }
143
+ ]
144
+ };
145
+ //#endregion
146
+ export { e as circularGraphDemo };
@@ -0,0 +1,138 @@
1
+ "use client";
2
+ import { Plot as e, Tooltip as t } from "../core.js";
3
+ import { noteOf as n, noteSpace as r, sansWidth as i, stagger as a } from "../util.js";
4
+ import { DimGroup as o, HitCircle as s, TipText as c } from "../hover.js";
5
+ import { FootNote as l } from "../plot-note.js";
6
+ import { ChartSvg as u } from "../svg.js";
7
+ import { Label as d } from "../text.js";
8
+ import { bundleLines as f } from "./util-b.js";
9
+ import { circularGraphDemo as p } from "./circular-graph.data.js";
10
+ import { LinkBundle as m } from "./link-bundle.js";
11
+ import { useState as h } from "react";
12
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
13
+ //#region src/charts/glance/circular-graph.tsx
14
+ var v = (e) => `${e}k moves`, y = (e) => `${e.source}→${e.target}`, b = (e, t) => t.source === e || t.target === e, x = (e, t) => {
15
+ let [n] = e.filter((e) => b(t, e)).toSorted((e, t) => t.value - e.value);
16
+ return n === void 0 ? "" : n.source === t ? n.target : n.source;
17
+ }, S = (e, t) => e ? "stroke-ink" : t ? "stroke-l2" : "stroke-l4", C = ({ links: e, at: t, cx: n, cy: r, focus: i, hero: o }) => {
18
+ let s = Math.max(...e.map((e) => e.value));
19
+ return /* @__PURE__ */ g("g", { children: e.map((e, c) => {
20
+ let l = t.get(e.source), u = t.get(e.target);
21
+ if (l === void 0 || u === void 0) return null;
22
+ let d = i !== null && b(i, e);
23
+ return /* @__PURE__ */ g(m, {
24
+ className: `draw transition-tone ${S(y(e) === o, d)} ${i !== null && !d ? "opacity-30" : ""}`,
25
+ lines: f(e.value, s),
26
+ q: {
27
+ x: ((l.x + u.x) / 2 + n) / 2,
28
+ y: ((l.y + u.y) / 2 + r) / 2
29
+ },
30
+ s: l,
31
+ style: a(c, "mark"),
32
+ t: u
33
+ }, y(e));
34
+ }) });
35
+ }, w = (e) => {
36
+ let t = Math.cos(e.a) > -.2;
37
+ return {
38
+ right: t,
39
+ x: e.x + Math.cos(e.a) * 4 + (t ? e.r + 8 : -e.r - 8)
40
+ };
41
+ }, T = ({ p: e, hero: t, dim: n, onEnter: r }) => {
42
+ let { right: i, x: c } = w(e);
43
+ return /* @__PURE__ */ _(o, {
44
+ dim: n,
45
+ onPointerEnter: r,
46
+ children: [
47
+ /* @__PURE__ */ g(s, {
48
+ cx: e.x,
49
+ cy: e.y,
50
+ r: e.r + 8
51
+ }),
52
+ /* @__PURE__ */ g("circle", {
53
+ className: `pop ${t ? "fill-hero" : "fill-paper stroke-l3"}`,
54
+ style: a(e.i, "mark"),
55
+ cx: e.x,
56
+ cy: e.y,
57
+ r: t ? e.r : e.r - .75,
58
+ strokeWidth: t ? void 0 : 1.5
59
+ }),
60
+ /* @__PURE__ */ g(d, {
61
+ anchor: i ? "start" : "end",
62
+ dy: "0.35em",
63
+ muted: !t,
64
+ order: e.i,
65
+ tier: "mark",
66
+ voice: "label",
67
+ x: c,
68
+ y: e.y + Math.sin(e.a) * 6,
69
+ children: e.node.id
70
+ })
71
+ ]
72
+ });
73
+ }, E = (a) => {
74
+ let o = a.nodes ?? p.nodes, s = a.links ?? p.links, d = a.height ?? 460, f = a.format ?? v, [m, S] = h(null), E = Math.max(...o.map((e) => e.value)), D = a.highlight ?? o.find((e) => e.value === E)?.id ?? "", [O] = s.filter((e) => b(D, e)).toSorted((e, t) => t.value - e.value), k = m === null ? null : m.node.id, A = new Set(s.flatMap((e) => k !== null && b(k, e) ? [e.source, e.target] : [])), j = `Moves between ${o.length} regions: ${s.map((e) => `${e.source}–${e.target} ${f(e.value)}`).join(", ")}`;
75
+ return /* @__PURE__ */ g(e, {
76
+ overlay: m === null ? null : /* @__PURE__ */ g(t, {
77
+ x: m.x,
78
+ y: m.y - m.r - 4,
79
+ children: /* @__PURE__ */ g(c, {
80
+ facts: [f(m.node.value), `most with ${x(s, m.node.id)}`],
81
+ lead: m.node.id
82
+ })
83
+ }),
84
+ children: (e) => {
85
+ let t = e < 460, c = r(n(a), e - 16, 16), f = t ? 18 : 26, p = Math.min(d / 2 - f - 12, e / 2 - (t ? 70 : 96)), m = (e, t, n) => o.map((r, i) => {
86
+ let a = -Math.PI / 2 + i / o.length * Math.PI * 2 - Math.PI / o.length;
87
+ return {
88
+ a,
89
+ i,
90
+ node: r,
91
+ r: Math.max(3, f * Math.sqrt(r.value / E)),
92
+ x: e + t * Math.cos(a),
93
+ y: n + t * Math.sin(a)
94
+ };
95
+ }), h = (t) => m(e / 2, t, 0).flatMap((e) => {
96
+ let { right: t, x: n } = w(e), r = t ? n + i(e.node.id, 11) : n - i(e.node.id, 11);
97
+ return [
98
+ e.x - e.r,
99
+ e.x + e.r,
100
+ r
101
+ ];
102
+ }), v = Math.max(...h(p)) - Math.min(...h(p)), b = Math.max(40, p - Math.max(0, v - (e - 8)) / 2), x = Math.min(d, Math.round(2 * (b + f + 12) + c)), M = (x - c) / 2, N = h(b), P = e - (Math.min(...N) + Math.max(...N)) / 2, F = m(P, b, M), I = new Map(F.map((e) => [e.node.id, e]));
103
+ return /* @__PURE__ */ _(u, {
104
+ height: x,
105
+ label: j,
106
+ leave: () => {
107
+ S(null);
108
+ },
109
+ width: e,
110
+ children: [
111
+ /* @__PURE__ */ g(C, {
112
+ links: s,
113
+ at: I,
114
+ cx: P,
115
+ cy: M,
116
+ focus: k,
117
+ hero: O === void 0 ? "" : y(O)
118
+ }),
119
+ F.map((e) => /* @__PURE__ */ g(T, {
120
+ p: e,
121
+ hero: e.node.id === D,
122
+ dim: k !== null && k !== e.node.id && !A.has(e.node.id),
123
+ onEnter: () => {
124
+ S(e);
125
+ }
126
+ }, e.node.id)),
127
+ /* @__PURE__ */ g(l, {
128
+ height: x,
129
+ text: n(a),
130
+ width: e
131
+ })
132
+ ]
133
+ });
134
+ }
135
+ });
136
+ };
137
+ //#endregion
138
+ export { E as CircularGraph };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ //#region src/charts/glance/control-slot.tsx
4
+ var t = (t) => /* @__PURE__ */ e("div", {
5
+ className: "flex h-11 items-center gap-1",
6
+ children: t.children
7
+ });
8
+ //#endregion
9
+ export { t as ControlSlot };
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ //#region src/charts/glance/diverging-bar.data.ts
3
+ var e = [
4
+ {
5
+ label: "Muhammad",
6
+ value: 2227
7
+ },
8
+ {
9
+ label: "Luca",
10
+ value: 2099
11
+ },
12
+ {
13
+ label: "Arlo",
14
+ value: 1464
15
+ },
16
+ {
17
+ label: "Theodore",
18
+ value: 1336
19
+ },
20
+ {
21
+ label: "Jacob",
22
+ value: -3592
23
+ },
24
+ {
25
+ label: "Jack",
26
+ value: -3776
27
+ },
28
+ {
29
+ label: "Oliver",
30
+ value: -3787
31
+ }
32
+ ];
33
+ //#endregion
34
+ export { e as divergingBarDemo };
@@ -0,0 +1,154 @@
1
+ "use client";
2
+ import { fmtInt as e } from "../../lib/format.js";
3
+ import { useHover as t } from "../hooks.js";
4
+ import { Plot as n, Tooltip as r } from "../core.js";
5
+ import { noteOf as i, noteSpace as a, stagger as o } from "../util.js";
6
+ import { DimGroup as s, HitRect as c, TipText as l } from "../hover.js";
7
+ import { crisp as u } from "../axes.js";
8
+ import { barPath as d } from "../shapes.js";
9
+ import { FootNote as f } from "../plot-note.js";
10
+ import { VGrid as p, VRule as m } from "../rules.js";
11
+ import { ChartSvg as h } from "../svg.js";
12
+ import { Label as g } from "../text.js";
13
+ import { paint as _, useTextureIds as v } from "../texture-ids.js";
14
+ import { Hatch as y, Stipple as b } from "../texture.js";
15
+ import { labelRoom as x } from "./util-a.js";
16
+ import { divergingBarDemo as S } from "./diverging-bar.data.js";
17
+ import { scaleBand as C, scaleLinear as w } from "d3-scale";
18
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
19
+ //#region src/charts/glance/diverging-bar.tsx
20
+ var D = (e) => {
21
+ let [, t] = w().domain([0, e]).ticks(4);
22
+ return t ?? 1;
23
+ }, O = (e) => {
24
+ let t = e.d.value >= 0, { onPointerEnter: n } = e;
25
+ return /* @__PURE__ */ E(s, {
26
+ dim: e.dim,
27
+ onPointerEnter: n,
28
+ children: [
29
+ /* @__PURE__ */ T(c, {
30
+ x: 0,
31
+ y: e.cy - e.band / 2,
32
+ width: e.width,
33
+ height: e.band
34
+ }),
35
+ /* @__PURE__ */ T(g, {
36
+ anchor: "end",
37
+ dy: "0.35em",
38
+ muted: !e.hero,
39
+ voice: "label",
40
+ x: e.labelW,
41
+ y: e.cy,
42
+ children: e.d.label
43
+ }),
44
+ /* @__PURE__ */ T("path", {
45
+ className: `grow-x ${t ? "" : "from-right"} ${e.fill.className}`,
46
+ style: o(e.i, "series"),
47
+ d: e.fill.pattern === void 0 ? d(Math.min(e.zero, e.x1), e.cy - e.bh / 2, Math.abs(e.x1 - e.zero), e.bh, t ? "right" : "left") : d(u(Math.min(e.zero, e.x1)), u(e.cy - e.bh / 2), Math.round(Math.abs(e.x1 - e.zero)), Math.round(e.bh) - 1, t ? "right" : "left"),
48
+ fill: e.fill.pattern,
49
+ strokeWidth: 1
50
+ }),
51
+ /* @__PURE__ */ T(g, {
52
+ anchor: t ? "start" : "end",
53
+ dy: "0.35em",
54
+ muted: !e.hero,
55
+ order: e.i + 3,
56
+ tier: "series",
57
+ voice: "value",
58
+ x: t ? e.x1 + 8 : e.x1 - 8,
59
+ y: e.cy,
60
+ children: e.text
61
+ })
62
+ ]
63
+ });
64
+ }, k = (t) => t === 0 ? "0" : `${t > 0 ? "+" : "−"}${e(Math.abs(t))}`, A = (e) => {
65
+ let t = [Math.floor(e.lo / e.step) * e.step - (e.lo < 0 ? e.step * .5 : 0), Math.ceil(e.hi / e.step) * e.step], n = e.m.left + (e.lo < 0 ? 28 : 0), r = e.width - 4 - 8 - e.valueW, i = e.hi > 0 ? Math.min(e.width - 4, n + (r - n) * (t[1] - t[0]) / (e.hi - t[0])) : e.width - e.m.right;
66
+ return w().domain(t).range([n, i]);
67
+ }, j = ([e, t], n) => {
68
+ let r = Math.ceil(e / n) * n;
69
+ return Array.from({ length: Math.floor((t - r) / n) + 1 }, (e, t) => r + t * n).filter((e) => e !== 0);
70
+ }, M = (e, t, n, r) => t ? { className: "fill-hero" } : e ? {
71
+ className: "stroke-l5 shape-crisp",
72
+ pattern: _(r("hatch"))
73
+ } : n ? { className: "fill-alert" } : {
74
+ className: "stroke-l5 shape-crisp",
75
+ pattern: _(r("dots"))
76
+ }, N = (e) => {
77
+ let o = e.data ?? S, s = e.height ?? 340, c = e.format ?? k, d = t(), g = o.map((e) => `${e.label} ${c(e.value)}`).join(", "), _ = Math.min(0, ...o.map((e) => e.value)), w = Math.max(0, ...o.map((e) => e.value)), N = D(Math.max(-_, w)), P = v("net"), F = e.highlight ?? o.findIndex((e) => e.value === w && w > 0);
78
+ return /* @__PURE__ */ T(n, {
79
+ overlay: d.at === null ? null : /* @__PURE__ */ T(r, {
80
+ x: d.at.x,
81
+ y: d.at.y,
82
+ children: /* @__PURE__ */ T(l, {
83
+ facts: [c(o[d.at.key].value)],
84
+ lead: o[d.at.key].label
85
+ })
86
+ }),
87
+ children: (t) => {
88
+ let n = t < 460, r = x(o.map((e) => e.label), "t-label") + 4, l = x(o.map((e) => c(e.value)), "t-value"), v = {
89
+ bottom: 4 + a(i(e), t - 16, 24),
90
+ left: r + 16,
91
+ right: 40,
92
+ top: 4
93
+ }, S = A({
94
+ hi: w,
95
+ lo: _,
96
+ m: v,
97
+ step: N,
98
+ valueW: l,
99
+ width: t
100
+ }), D = C().domain(o.map((e, t) => t)).range([v.top, s - v.bottom]).paddingInner(.64).paddingOuter(.32), k = u(S(0)), I = j(S.domain(), N * (n ? 2 : 1));
101
+ return /* @__PURE__ */ E(h, {
102
+ height: s,
103
+ label: g,
104
+ leave: d.clear,
105
+ width: t,
106
+ children: [
107
+ /* @__PURE__ */ E("defs", { children: [/* @__PURE__ */ T(y, {
108
+ id: P("hatch"),
109
+ tone: "fill-l3"
110
+ }), /* @__PURE__ */ T(b, {
111
+ id: P("dots"),
112
+ tone: "fill-l3"
113
+ })] }),
114
+ /* @__PURE__ */ T(p, {
115
+ xs: I.map((e) => S(e)),
116
+ y0: v.top,
117
+ y1: s - v.bottom
118
+ }),
119
+ o.map((n, i) => {
120
+ let a = (D(i) ?? 0) + D.bandwidth() / 2, o = Math.min(D.bandwidth(), 22);
121
+ return /* @__PURE__ */ T(O, {
122
+ d: n,
123
+ i,
124
+ cy: a,
125
+ zero: k,
126
+ x1: S(n.value),
127
+ bh: o,
128
+ fill: M(n.value >= 0, F === i, e.alertLosses === !0, P),
129
+ hero: F === i,
130
+ labelW: r,
131
+ width: t,
132
+ band: D.step(),
133
+ dim: d.dim(i),
134
+ text: c(n.value),
135
+ onPointerEnter: d.enter(i, S(n.value), a - o / 2 - 2)
136
+ }, n.label);
137
+ }),
138
+ /* @__PURE__ */ T(m, {
139
+ x: S(0),
140
+ y0: v.top,
141
+ y1: s - v.bottom
142
+ }),
143
+ /* @__PURE__ */ T(f, {
144
+ height: s,
145
+ text: i(e),
146
+ width: t
147
+ })
148
+ ]
149
+ });
150
+ }
151
+ });
152
+ };
153
+ //#endregion
154
+ export { N as DivergingBar };
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ //#region src/charts/glance/dot-waffle.data.ts
3
+ var e = [
4
+ {
5
+ label: "Rose family",
6
+ value: 23.6
7
+ },
8
+ {
9
+ label: "Cabbage family",
10
+ value: 20.5
11
+ },
12
+ {
13
+ label: "Pea family",
14
+ value: 16.1
15
+ },
16
+ {
17
+ label: "Borage family",
18
+ value: 7.9
19
+ },
20
+ {
21
+ label: "Everything else",
22
+ value: 31.9
23
+ }
24
+ ];
25
+ //#endregion
26
+ export { e as dotWaffleDemo };
@@ -0,0 +1,179 @@
1
+ "use client";
2
+ import { useHover as e } from "../hooks.js";
3
+ import { Plot as t, Tooltip as n } from "../core.js";
4
+ import { dimClass as r, noteOf as i, noteSpace as a, ranks as o, stagger as s } from "../util.js";
5
+ import { DimGroup as c, HitRect as l, TipText as u } from "../hover.js";
6
+ import { KEY as d } from "../marks.js";
7
+ import { FootNote as f } from "../plot-note.js";
8
+ import { ChartSvg as p } from "../svg.js";
9
+ import { Label as m } from "../text.js";
10
+ import { paint as h, useTextureIds as g } from "../texture-ids.js";
11
+ import { CrossHatch as _, Hatch as v, KeySwatch as y, Rules as b, Stipple as x } from "../texture.js";
12
+ import { labelRoom as S } from "./util-a.js";
13
+ import { dotWaffleDemo as C } from "./dot-waffle.data.js";
14
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
15
+ //#region src/charts/glance/dot-waffle.tsx
16
+ var E = 28, D = d.swatch, O = [
17
+ "cross",
18
+ "hatch",
19
+ "rule",
20
+ "dots"
21
+ ], k = (e, t) => {
22
+ if (e === 0) return {
23
+ className: "fill-hero",
24
+ outlined: !1
25
+ };
26
+ let n = O.at(e - 1);
27
+ return n === void 0 ? {
28
+ className: "stroke-l5 fill-paper",
29
+ outlined: !0
30
+ } : {
31
+ className: "stroke-l5",
32
+ fill: h(t(n)),
33
+ outlined: !0
34
+ };
35
+ }, A = (e, t) => {
36
+ let n = o(e), r = t ?? n.indexOf(0);
37
+ return n.map((e, t) => t === r ? 0 : e < n[r] ? e + 1 : e);
38
+ }, j = (e, t) => {
39
+ let n = e.reduce((e, t) => e + t, 0), r = e.map((e) => n > 0 ? e / n * t : 0), i = r.map((e) => Math.floor(e)), a = t - i.reduce((e, t) => e + t, 0), o = r.map((e, t) => ({
40
+ i: t,
41
+ r: e - Math.floor(e)
42
+ })).toSorted((e, t) => t.r - e.r);
43
+ for (let e = 0; e < a; e += 1) i[o[e % o.length].i] += 1;
44
+ return i;
45
+ }, M = (e) => `${e}%`, N = (e, t) => Math.max(130, D + d.gap + S(e.map((e) => e.label), "t-label") + 16 + S(e.map((e) => t(e.value)), "t-value") + 8), P = (e) => /* @__PURE__ */ w("g", { children: e.data.map((t, n) => {
46
+ let { x: r, y: i } = e.at(n);
47
+ return /* @__PURE__ */ w(c, {
48
+ dim: e.dim(n),
49
+ onPointerEnter: () => {
50
+ e.onEnter(n, r + e.hitWidth / 2, i - 10);
51
+ },
52
+ children: /* @__PURE__ */ T("g", {
53
+ className: "fade",
54
+ style: s(n + 6, "series"),
55
+ children: [
56
+ /* @__PURE__ */ w(l, {
57
+ x: r,
58
+ y: i - E / 2,
59
+ width: e.hitWidth,
60
+ height: E
61
+ }),
62
+ /* @__PURE__ */ w(y, {
63
+ fill: e.looks[n].fill,
64
+ tone: e.looks[n].fill === void 0 ? e.looks[n].className : void 0,
65
+ x: r,
66
+ y: i - D / 2
67
+ }),
68
+ /* @__PURE__ */ w(m, {
69
+ dy: "0.35em",
70
+ voice: "label",
71
+ x: r + D + d.gap,
72
+ y: i,
73
+ children: t.label
74
+ }),
75
+ /* @__PURE__ */ w(m, {
76
+ anchor: "end",
77
+ dy: "0.35em",
78
+ voice: "value",
79
+ x: r + e.hitWidth - e.inset,
80
+ y: i,
81
+ children: e.format(t.value)
82
+ })
83
+ ]
84
+ })
85
+ }, t.label);
86
+ }) }), F = ({ dim: e, dots: t, looks: n, onEnter: i, side: a }) => /* @__PURE__ */ w("g", { children: t.map((t) => {
87
+ let o = n[t.owner], c = o.outlined ? .5 : 0;
88
+ return /* @__PURE__ */ w("rect", {
89
+ className: `pop ${o.className} ${r(e(t.owner))}`,
90
+ style: s(t.order, "dense"),
91
+ x: Math.round(t.cx - a / 2) + c,
92
+ y: Math.round(t.cy - a / 2) + c,
93
+ width: a - c * 2,
94
+ height: a - c * 2,
95
+ rx: 2,
96
+ fill: o.fill,
97
+ strokeWidth: 1,
98
+ onPointerEnter: () => {
99
+ i(t.owner, t.cx, t.cy - a / 2 - 2);
100
+ }
101
+ }, t.id);
102
+ }) }), I = (r) => {
103
+ let o = r.data ?? C, s = r.height ?? 340, c = r.format ?? M, l = e(), d = l.show, m = g("waffle"), h = A(o.map((e) => e.value), r.highlight).map((e) => k(e, m)), y = j(o.map((e) => e.value), 100).flatMap((e, t) => Array.from({ length: e }, () => t)), S = `Share of the pollen in honey, one square for each per cent: ${o.map((e) => `${e.label} ${c(e.value)}`).join(", ")}`;
104
+ return /* @__PURE__ */ w(t, {
105
+ overlay: l.at === null ? null : /* @__PURE__ */ w(n, {
106
+ x: l.at.x,
107
+ y: l.at.y,
108
+ children: /* @__PURE__ */ w(u, {
109
+ facts: [c(o[l.at.key].value)],
110
+ lead: o[l.at.key].label
111
+ })
112
+ }),
113
+ children: (e) => {
114
+ let t = e < 460, n = t ? 0 : N(o, c), u = t ? 0 : n + 20, g = a(i(r), e - 16, 22), C = t ? Math.ceil(o.length / 2) : 0, D = Math.min(s - 8 - g - C * E, e - u - 16, 300) / 10, O = Math.round(D * .74), k = D * 10, A = (e - k - u) / 2, j = t ? k + 20 + C * E + g : s, M = Math.min(E, (k - 8) / o.length), I = y.map((e, t) => ({
115
+ cx: A + (t % 10 + .5) * D,
116
+ cy: 4 + (Math.floor(t / 10) + .5) * D,
117
+ id: `dot-${t}`,
118
+ order: t,
119
+ owner: e
120
+ }));
121
+ return /* @__PURE__ */ T(p, {
122
+ height: j,
123
+ label: S,
124
+ leave: l.clear,
125
+ width: e,
126
+ children: [
127
+ /* @__PURE__ */ T("defs", { children: [
128
+ /* @__PURE__ */ w(_, {
129
+ id: m("cross"),
130
+ tone: "fill-l2"
131
+ }),
132
+ /* @__PURE__ */ w(v, {
133
+ id: m("hatch"),
134
+ tone: "fill-l3"
135
+ }),
136
+ /* @__PURE__ */ w(b, {
137
+ id: m("rule"),
138
+ tone: "fill-l3"
139
+ }),
140
+ /* @__PURE__ */ w(x, {
141
+ id: m("dots"),
142
+ tone: "fill-l3"
143
+ })
144
+ ] }),
145
+ /* @__PURE__ */ w(F, {
146
+ dim: l.dim,
147
+ dots: I,
148
+ looks: h,
149
+ onEnter: d,
150
+ side: O
151
+ }),
152
+ /* @__PURE__ */ w(P, {
153
+ data: o,
154
+ looks: h,
155
+ dim: l.dim,
156
+ format: c,
157
+ at: (n) => t ? {
158
+ x: n % 2 * ((e + 16) / 2),
159
+ y: k + 26 + Math.floor(n / 2) * E
160
+ } : {
161
+ x: A + k + 28,
162
+ y: 4 + D * .5 + n * M
163
+ },
164
+ hitWidth: t ? (e - 16) / 2 : n,
165
+ inset: t ? 0 : 8,
166
+ onEnter: d
167
+ }),
168
+ /* @__PURE__ */ w(f, {
169
+ height: j,
170
+ text: i(r),
171
+ width: e
172
+ })
173
+ ]
174
+ });
175
+ }
176
+ });
177
+ };
178
+ //#endregion
179
+ export { I as DotWaffle };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import e from "./draw-in.goals.json.js";
3
+ //#region src/charts/glance/draw-in.data.ts
4
+ var t = Date.UTC(2024, 7, 16), n = 864e5, r = 0, i = e.map((e, i) => (r += e, {
5
+ date: new Date(t + i * n),
6
+ value: r
7
+ }));
8
+ //#endregion
9
+ export { i as drawInDemo };