@howells/hairline 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +148 -2
  3. package/lib/charts/axes.js +5 -0
  4. package/lib/charts/basics/candlestick.data.js +44 -0
  5. package/lib/charts/basics/candlestick.js +180 -0
  6. package/lib/charts/basics/daily-empty.js +24 -0
  7. package/lib/charts/basics/daily-readings.js +16 -0
  8. package/lib/charts/basics/dot-heat.data.js +225 -0
  9. package/lib/charts/basics/dot-heat.js +174 -0
  10. package/lib/charts/basics/dumbbell-queue.js +203 -0
  11. package/lib/charts/basics/hairline-area.js +208 -0
  12. package/lib/charts/basics/hairline-line.js +195 -0
  13. package/lib/charts/basics/nested-treemap.data.js +55 -0
  14. package/lib/charts/basics/nested-treemap.js +191 -0
  15. package/lib/charts/basics/paired-rungs.data.js +31 -0
  16. package/lib/charts/basics/paired-rungs.js +151 -0
  17. package/lib/charts/basics/plumb-scatter.js +229 -0
  18. package/lib/charts/basics/rung-bars.js +178 -0
  19. package/lib/charts/basics/rung-geometry.js +6 -0
  20. package/lib/charts/basics/rung-histogram.data.js +73 -0
  21. package/lib/charts/basics/rung-histogram.js +153 -0
  22. package/lib/charts/basics/rung-waterfall.data.js +30 -0
  23. package/lib/charts/basics/rung-waterfall.js +150 -0
  24. package/lib/charts/basics/rungs.js +22 -0
  25. package/lib/charts/basics/series-key.js +26 -0
  26. package/lib/charts/basics/stacked-rungs.data.js +42 -0
  27. package/lib/charts/basics/stacked-rungs.js +174 -0
  28. package/lib/charts/basics/stream-ribbon.data.js +124 -0
  29. package/lib/charts/basics/stream-ribbon.js +336 -0
  30. package/lib/charts/basics/tick-box.data.js +50 -0
  31. package/lib/charts/basics/tick-box.js +226 -0
  32. package/lib/charts/basics/tick-donut.data.js +30 -0
  33. package/lib/charts/basics/tick-donut.js +210 -0
  34. package/lib/charts/basics/tick-gauge.data.js +8 -0
  35. package/lib/charts/basics/tick-gauge.js +169 -0
  36. package/lib/charts/basics/tick-rows.data.js +30 -0
  37. package/lib/charts/basics/tick-rows.js +121 -0
  38. package/lib/charts/basics/util-a.js +15 -0
  39. package/lib/charts/basics/util-b.js +13 -0
  40. package/lib/charts/big/circular-graph.data.js +827 -0
  41. package/lib/charts/big/circular-graph.js +289 -0
  42. package/lib/charts/big/force-galaxy-model.js +167 -0
  43. package/lib/charts/big/force-galaxy.data.js +813 -0
  44. package/lib/charts/big/force-galaxy.js +276 -0
  45. package/lib/charts/big/thread-triptych.data.js +204 -0
  46. package/lib/charts/big/thread-triptych.js +334 -0
  47. package/lib/charts/board/room.js +6 -0
  48. package/lib/charts/board/slope.js +176 -0
  49. package/lib/charts/board/spread.js +28 -0
  50. package/lib/charts/control.js +18 -0
  51. package/lib/charts/core.js +84 -0
  52. package/lib/charts/data-table.js +34 -0
  53. package/lib/charts/fills.js +153 -0
  54. package/lib/charts/forms/area-difference.data.js +62 -0
  55. package/lib/charts/forms/area-difference.js +192 -0
  56. package/lib/charts/forms/brush-math.js +42 -0
  57. package/lib/charts/forms/brush-strip.js +199 -0
  58. package/lib/charts/forms/brushed-overview.data.js +374 -0
  59. package/lib/charts/forms/brushed-overview.js +162 -0
  60. package/lib/charts/forms/chord-ring.data.js +140 -0
  61. package/lib/charts/forms/chord-ring.js +167 -0
  62. package/lib/charts/forms/circle-pack.data.js +80 -0
  63. package/lib/charts/forms/circle-pack.js +99 -0
  64. package/lib/charts/forms/hatched-stack.data.js +71 -0
  65. package/lib/charts/forms/hatched-stack.js +228 -0
  66. package/lib/charts/forms/radial-year.data.js +13 -0
  67. package/lib/charts/forms/radial-year.js +156 -0
  68. package/lib/charts/frame.js +73 -0
  69. package/lib/charts/glance/aggregate-sankey.data.js +74 -0
  70. package/lib/charts/glance/aggregate-sankey.js +242 -0
  71. package/lib/charts/glance/bar-race.data.js +122 -0
  72. package/lib/charts/glance/bar-race.js +246 -0
  73. package/lib/charts/glance/big-slice.data.js +41 -0
  74. package/lib/charts/glance/big-slice.js +238 -0
  75. package/lib/charts/glance/chunky-bars.data.js +22 -0
  76. package/lib/charts/glance/chunky-bars.js +113 -0
  77. package/lib/charts/glance/circular-graph.data.js +146 -0
  78. package/lib/charts/glance/circular-graph.js +138 -0
  79. package/lib/charts/glance/control-slot.js +9 -0
  80. package/lib/charts/glance/diverging-bar.data.js +34 -0
  81. package/lib/charts/glance/diverging-bar.js +154 -0
  82. package/lib/charts/glance/dot-waffle.data.js +26 -0
  83. package/lib/charts/glance/dot-waffle.js +179 -0
  84. package/lib/charts/glance/draw-in.data.js +9 -0
  85. package/lib/charts/glance/draw-in.goals.json.js +289 -0
  86. package/lib/charts/glance/draw-in.js +214 -0
  87. package/lib/charts/glance/dynamic-stream.data.js +6 -0
  88. package/lib/charts/glance/dynamic-stream.js +189 -0
  89. package/lib/charts/glance/force-graph.data.js +77 -0
  90. package/lib/charts/glance/force-graph.js +211 -0
  91. package/lib/charts/glance/jitter-strip.data.js +10 -0
  92. package/lib/charts/glance/jitter-strip.easter.json.js +430 -0
  93. package/lib/charts/glance/jitter-strip.js +157 -0
  94. package/lib/charts/glance/link-bundle.js +51 -0
  95. package/lib/charts/glance/matrix-heat-glance.data.js +108 -0
  96. package/lib/charts/glance/matrix-heat-glance.js +170 -0
  97. package/lib/charts/glance/pictorial-bar.data.js +22 -0
  98. package/lib/charts/glance/pictorial-bar.js +180 -0
  99. package/lib/charts/glance/rainfall-dual-area.data.js +177 -0
  100. package/lib/charts/glance/rainfall-dual-area.js +192 -0
  101. package/lib/charts/glance/rank-strip.data.js +76 -0
  102. package/lib/charts/glance/rank-strip.js +172 -0
  103. package/lib/charts/glance/scatter-labels.js +60 -0
  104. package/lib/charts/glance/scatter-morph.data.js +78 -0
  105. package/lib/charts/glance/scatter-morph.js +338 -0
  106. package/lib/charts/glance/single-axis.data.js +6 -0
  107. package/lib/charts/glance/single-axis.js +150 -0
  108. package/lib/charts/glance/single-axis.tides.json.js +180 -0
  109. package/lib/charts/glance/stagger-wave.data.js +66 -0
  110. package/lib/charts/glance/stagger-wave.js +132 -0
  111. package/lib/charts/glance/tree-lr.data.js +41 -0
  112. package/lib/charts/glance/tree-lr.js +135 -0
  113. package/lib/charts/glance/util-a.js +49 -0
  114. package/lib/charts/glance/util-b.js +19 -0
  115. package/lib/charts/glance/violin.data.js +9 -0
  116. package/lib/charts/glance/violin.js +185 -0
  117. package/lib/charts/glance/violin.tenors.json.js +5 -0
  118. package/lib/charts/hooks.js +154 -0
  119. package/lib/charts/hover.js +19 -0
  120. package/lib/charts/lupi/arc-matrix.data.js +83 -0
  121. package/lib/charts/lupi/arc-matrix.js +146 -0
  122. package/lib/charts/lupi/ballot-tally.data.js +22 -0
  123. package/lib/charts/lupi/ballot-tally.js +125 -0
  124. package/lib/charts/lupi/barcode-lollipop.data.js +195 -0
  125. package/lib/charts/lupi/barcode-lollipop.js +161 -0
  126. package/lib/charts/lupi/brand-spectrum.data.js +70 -0
  127. package/lib/charts/lupi/brand-spectrum.js +233 -0
  128. package/lib/charts/lupi/bubble-almanac.data.js +689 -0
  129. package/lib/charts/lupi/bubble-almanac.js +164 -0
  130. package/lib/charts/lupi/calendar-heat.data.js +399 -0
  131. package/lib/charts/lupi/calendar-heat.js +175 -0
  132. package/lib/charts/lupi/cluster-field.data.js +83 -0
  133. package/lib/charts/lupi/cluster-field.js +173 -0
  134. package/lib/charts/lupi/dot-cascade.data.js +54 -0
  135. package/lib/charts/lupi/dot-cascade.js +124 -0
  136. package/lib/charts/lupi/dotty-matrix.data.js +170 -0
  137. package/lib/charts/lupi/dotty-matrix.js +126 -0
  138. package/lib/charts/lupi/hourglass-stream.data.js +30 -0
  139. package/lib/charts/lupi/hourglass-stream.js +158 -0
  140. package/lib/charts/lupi/hundred-field.data.js +38 -0
  141. package/lib/charts/lupi/hundred-field.js +237 -0
  142. package/lib/charts/lupi/launch-fan.data.js +315 -0
  143. package/lib/charts/lupi/launch-fan.js +198 -0
  144. package/lib/charts/lupi/matrix-heat.data.js +97 -0
  145. package/lib/charts/lupi/matrix-heat.js +246 -0
  146. package/lib/charts/lupi/parallel-coordinates.data.js +54 -0
  147. package/lib/charts/lupi/parallel-coordinates.js +218 -0
  148. package/lib/charts/lupi/radial-convergence.data.js +178 -0
  149. package/lib/charts/lupi/radial-convergence.js +208 -0
  150. package/lib/charts/lupi/radial-patchwork.data.js +454 -0
  151. package/lib/charts/lupi/radial-patchwork.js +181 -0
  152. package/lib/charts/lupi/ridgeline.data.js +1834 -0
  153. package/lib/charts/lupi/ridgeline.js +195 -0
  154. package/lib/charts/lupi/trend-lineage.data.js +51 -0
  155. package/lib/charts/lupi/trend-lineage.js +198 -0
  156. package/lib/charts/lupi/type-colonnade.data.js +18 -0
  157. package/lib/charts/lupi/type-colonnade.js +198 -0
  158. package/lib/charts/lupi/util-a.js +14 -0
  159. package/lib/charts/lupi/util-b.js +12 -0
  160. package/lib/charts/maps/choropleth.js +295 -0
  161. package/lib/charts/maps/geo.js +84 -0
  162. package/lib/charts/maps/legend.js +83 -0
  163. package/lib/charts/maps/step-fill.js +9 -0
  164. package/lib/charts/maps/us-choropleth.data.js +249 -0
  165. package/lib/charts/maps/us-choropleth.js +41 -0
  166. package/lib/charts/maps/world-choropleth.data.js +681 -0
  167. package/lib/charts/maps/world-choropleth.js +46 -0
  168. package/lib/charts/markers.js +35 -0
  169. package/lib/charts/marks.js +31 -0
  170. package/lib/charts/motion.js +11 -0
  171. package/lib/charts/originals/daily-users.data.js +101 -0
  172. package/lib/charts/originals/daily-users.js +203 -0
  173. package/lib/charts/originals/feature-rank.data.js +92 -0
  174. package/lib/charts/originals/feature-rank.js +167 -0
  175. package/lib/charts/originals/format.js +5 -0
  176. package/lib/charts/originals/key.js +26 -0
  177. package/lib/charts/originals/response-time.data.js +98 -0
  178. package/lib/charts/originals/response-time.js +187 -0
  179. package/lib/charts/originals/revenue-by-plan.data.js +26 -0
  180. package/lib/charts/originals/revenue-by-plan.js +248 -0
  181. package/lib/charts/playback.js +68 -0
  182. package/lib/charts/plot-note.js +27 -0
  183. package/lib/charts/roles.js +5 -0
  184. package/lib/charts/rules.js +66 -0
  185. package/lib/charts/scale-context.js +6 -0
  186. package/lib/charts/shapes.js +8 -0
  187. package/lib/charts/shared-options.js +25 -0
  188. package/lib/charts/svg.js +43 -0
  189. package/lib/charts/text.js +30 -0
  190. package/lib/charts/texture-ids.js +20 -0
  191. package/lib/charts/texture.js +286 -0
  192. package/lib/charts/util.js +43 -0
  193. package/lib/charts/value-grid.js +26 -0
  194. package/lib/draw.js +27 -0
  195. package/lib/entries/dumbbell-queue.js +2 -0
  196. package/lib/entries/hairline-area.js +2 -0
  197. package/lib/entries/hairline-line.js +2 -0
  198. package/lib/entries/plumb-scatter.js +2 -0
  199. package/lib/entries/rung-bars.js +2 -0
  200. package/lib/entries/slope.js +2 -0
  201. package/lib/frame.js +2 -0
  202. package/lib/hairline.css +1385 -0
  203. package/lib/index.js +72 -0
  204. package/lib/json-schema/dumbbell-queue.json +258 -0
  205. package/lib/json-schema/hairline-area.json +262 -0
  206. package/lib/json-schema/hairline-line.json +256 -0
  207. package/lib/json-schema/index.json +50 -0
  208. package/lib/json-schema/plumb-scatter.json +363 -0
  209. package/lib/json-schema/rung-bars.json +230 -0
  210. package/lib/json-schema/slope.json +333 -0
  211. package/lib/kit.js +16 -0
  212. package/lib/lib/format.js +29 -0
  213. package/lib/lib/random.js +8 -0
  214. package/lib/maps.js +4 -0
  215. package/lib/schema/daily.js +9 -0
  216. package/lib/schema/dumbbell-queue.js +28 -0
  217. package/lib/schema/format.js +72 -0
  218. package/lib/schema/hairline-area.js +24 -0
  219. package/lib/schema/hairline-line.js +23 -0
  220. package/lib/schema/key.js +4 -0
  221. package/lib/schema/metrics.js +26 -0
  222. package/lib/schema/motion.js +12 -0
  223. package/lib/schema/options.js +21 -0
  224. package/lib/schema/plumb-scatter.js +48 -0
  225. package/lib/schema/registry.js +132 -0
  226. package/lib/schema/rung-bars.js +25 -0
  227. package/lib/schema/scale.js +9 -0
  228. package/lib/schema/slope.js +28 -0
  229. package/lib/schema/validate.js +25 -0
  230. package/lib/schema.js +16 -0
  231. package/lib/theme/derive.js +98 -0
  232. package/lib/theme.css +443 -0
  233. package/lib/theme.js +1 -0
  234. package/lib/tokens.css +306 -0
  235. package/lib/types/charts/axes.d.ts +14 -0
  236. package/lib/types/charts/basics/candlestick.d.ts +22 -0
  237. package/lib/types/charts/basics/candlestick.data.d.ts +10 -0
  238. package/lib/types/charts/basics/daily-empty.d.ts +7 -0
  239. package/lib/types/charts/basics/daily-readings.d.ts +38 -0
  240. package/lib/types/charts/basics/dot-heat.d.ts +19 -0
  241. package/lib/types/charts/basics/dot-heat.data.d.ts +28 -0
  242. package/lib/types/charts/basics/dumbbell-queue.d.ts +15 -0
  243. package/lib/types/charts/basics/hairline-area.d.ts +18 -0
  244. package/lib/types/charts/basics/hairline-line.d.ts +18 -0
  245. package/lib/types/charts/basics/nested-treemap.d.ts +18 -0
  246. package/lib/types/charts/basics/nested-treemap.data.d.ts +30 -0
  247. package/lib/types/charts/basics/paired-rungs.d.ts +21 -0
  248. package/lib/types/charts/basics/paired-rungs.data.d.ts +43 -0
  249. package/lib/types/charts/basics/plumb-scatter.d.ts +14 -0
  250. package/lib/types/charts/basics/rung-bars.d.ts +16 -0
  251. package/lib/types/charts/basics/rung-geometry.d.ts +6 -0
  252. package/lib/types/charts/basics/rung-histogram.d.ts +22 -0
  253. package/lib/types/charts/basics/rung-histogram.data.d.ts +34 -0
  254. package/lib/types/charts/basics/rung-waterfall.d.ts +19 -0
  255. package/lib/types/charts/basics/rung-waterfall.data.d.ts +31 -0
  256. package/lib/types/charts/basics/rungs.d.ts +28 -0
  257. package/lib/types/charts/basics/series-key.d.ts +19 -0
  258. package/lib/types/charts/basics/stacked-rungs.d.ts +20 -0
  259. package/lib/types/charts/basics/stacked-rungs.data.d.ts +26 -0
  260. package/lib/types/charts/basics/stream-ribbon.d.ts +19 -0
  261. package/lib/types/charts/basics/stream-ribbon.data.d.ts +29 -0
  262. package/lib/types/charts/basics/tick-box.d.ts +19 -0
  263. package/lib/types/charts/basics/tick-box.data.d.ts +30 -0
  264. package/lib/types/charts/basics/tick-donut.d.ts +24 -0
  265. package/lib/types/charts/basics/tick-donut.data.d.ts +25 -0
  266. package/lib/types/charts/basics/tick-gauge.d.ts +22 -0
  267. package/lib/types/charts/basics/tick-gauge.data.d.ts +24 -0
  268. package/lib/types/charts/basics/tick-rows.d.ts +18 -0
  269. package/lib/types/charts/basics/tick-rows.data.d.ts +23 -0
  270. package/lib/types/charts/basics/util-a.d.ts +10 -0
  271. package/lib/types/charts/basics/util-b.d.ts +13 -0
  272. package/lib/types/charts/big/circular-graph.d.ts +20 -0
  273. package/lib/types/charts/big/circular-graph.data.d.ts +46 -0
  274. package/lib/types/charts/big/force-galaxy-model.d.ts +109 -0
  275. package/lib/types/charts/big/force-galaxy.d.ts +18 -0
  276. package/lib/types/charts/big/force-galaxy.data.d.ts +48 -0
  277. package/lib/types/charts/big/thread-triptych.d.ts +17 -0
  278. package/lib/types/charts/big/thread-triptych.data.d.ts +41 -0
  279. package/lib/types/charts/board/room.d.ts +18 -0
  280. package/lib/types/charts/board/slope.d.ts +14 -0
  281. package/lib/types/charts/board/spread.d.ts +5 -0
  282. package/lib/types/charts/control.d.ts +17 -0
  283. package/lib/types/charts/core.d.ts +77 -0
  284. package/lib/types/charts/data-table.d.ts +18 -0
  285. package/lib/types/charts/fills.d.ts +103 -0
  286. package/lib/types/charts/forms/area-difference.d.ts +9 -0
  287. package/lib/types/charts/forms/area-difference.data.d.ts +26 -0
  288. package/lib/types/charts/forms/brush-math.d.ts +19 -0
  289. package/lib/types/charts/forms/brush-strip.d.ts +19 -0
  290. package/lib/types/charts/forms/brushed-overview.d.ts +12 -0
  291. package/lib/types/charts/forms/brushed-overview.data.d.ts +16 -0
  292. package/lib/types/charts/forms/chord-ring.d.ts +12 -0
  293. package/lib/types/charts/forms/chord-ring.data.d.ts +29 -0
  294. package/lib/types/charts/forms/circle-pack.d.ts +9 -0
  295. package/lib/types/charts/forms/circle-pack.data.d.ts +23 -0
  296. package/lib/types/charts/forms/hatched-stack.d.ts +10 -0
  297. package/lib/types/charts/forms/hatched-stack.data.d.ts +36 -0
  298. package/lib/types/charts/forms/radial-year.d.ts +8 -0
  299. package/lib/types/charts/forms/radial-year.data.d.ts +17 -0
  300. package/lib/types/charts/frame.d.ts +21 -0
  301. package/lib/types/charts/glance/aggregate-sankey.d.ts +23 -0
  302. package/lib/types/charts/glance/aggregate-sankey.data.d.ts +32 -0
  303. package/lib/types/charts/glance/bar-race.d.ts +20 -0
  304. package/lib/types/charts/glance/bar-race.data.d.ts +32 -0
  305. package/lib/types/charts/glance/big-slice.d.ts +27 -0
  306. package/lib/types/charts/glance/big-slice.data.d.ts +30 -0
  307. package/lib/types/charts/glance/chunky-bars.d.ts +18 -0
  308. package/lib/types/charts/glance/chunky-bars.data.d.ts +24 -0
  309. package/lib/types/charts/glance/circular-graph.d.ts +19 -0
  310. package/lib/types/charts/glance/circular-graph.data.d.ts +43 -0
  311. package/lib/types/charts/glance/control-slot.d.ts +9 -0
  312. package/lib/types/charts/glance/diverging-bar.d.ts +19 -0
  313. package/lib/types/charts/glance/diverging-bar.data.d.ts +27 -0
  314. package/lib/types/charts/glance/dot-waffle.d.ts +19 -0
  315. package/lib/types/charts/glance/dot-waffle.data.d.ts +31 -0
  316. package/lib/types/charts/glance/draw-in.d.ts +20 -0
  317. package/lib/types/charts/glance/draw-in.data.d.ts +6 -0
  318. package/lib/types/charts/glance/dynamic-stream.d.ts +22 -0
  319. package/lib/types/charts/glance/dynamic-stream.data.d.ts +7 -0
  320. package/lib/types/charts/glance/force-graph.d.ts +16 -0
  321. package/lib/types/charts/glance/force-graph.data.d.ts +45 -0
  322. package/lib/types/charts/glance/jitter-strip.d.ts +24 -0
  323. package/lib/types/charts/glance/jitter-strip.data.d.ts +27 -0
  324. package/lib/types/charts/glance/link-bundle.d.ts +22 -0
  325. package/lib/types/charts/glance/matrix-heat-glance.d.ts +22 -0
  326. package/lib/types/charts/glance/matrix-heat-glance.data.d.ts +35 -0
  327. package/lib/types/charts/glance/pictorial-bar.d.ts +20 -0
  328. package/lib/types/charts/glance/pictorial-bar.data.d.ts +27 -0
  329. package/lib/types/charts/glance/rainfall-dual-area.d.ts +19 -0
  330. package/lib/types/charts/glance/rainfall-dual-area.data.d.ts +32 -0
  331. package/lib/types/charts/glance/rank-strip.d.ts +19 -0
  332. package/lib/types/charts/glance/rank-strip.data.d.ts +36 -0
  333. package/lib/types/charts/glance/scatter-labels.d.ts +23 -0
  334. package/lib/types/charts/glance/scatter-morph.d.ts +22 -0
  335. package/lib/types/charts/glance/scatter-morph.data.d.ts +30 -0
  336. package/lib/types/charts/glance/single-axis.d.ts +27 -0
  337. package/lib/types/charts/glance/single-axis.data.d.ts +6 -0
  338. package/lib/types/charts/glance/stagger-wave.d.ts +18 -0
  339. package/lib/types/charts/glance/stagger-wave.data.d.ts +26 -0
  340. package/lib/types/charts/glance/tree-lr.d.ts +16 -0
  341. package/lib/types/charts/glance/tree-lr.data.d.ts +27 -0
  342. package/lib/types/charts/glance/util-a.d.ts +31 -0
  343. package/lib/types/charts/glance/util-b.d.ts +12 -0
  344. package/lib/types/charts/glance/violin.d.ts +22 -0
  345. package/lib/types/charts/glance/violin.data.d.ts +24 -0
  346. package/lib/types/charts/hooks.d.ts +109 -0
  347. package/lib/types/charts/hover.d.ts +26 -0
  348. package/lib/types/charts/lupi/arc-matrix.d.ts +18 -0
  349. package/lib/types/charts/lupi/arc-matrix.data.d.ts +28 -0
  350. package/lib/types/charts/lupi/ballot-tally.d.ts +19 -0
  351. package/lib/types/charts/lupi/ballot-tally.data.d.ts +28 -0
  352. package/lib/types/charts/lupi/barcode-lollipop.d.ts +19 -0
  353. package/lib/types/charts/lupi/barcode-lollipop.data.d.ts +26 -0
  354. package/lib/types/charts/lupi/brand-spectrum.d.ts +28 -0
  355. package/lib/types/charts/lupi/brand-spectrum.data.d.ts +34 -0
  356. package/lib/types/charts/lupi/bubble-almanac.d.ts +22 -0
  357. package/lib/types/charts/lupi/bubble-almanac.data.d.ts +45 -0
  358. package/lib/types/charts/lupi/calendar-heat.d.ts +19 -0
  359. package/lib/types/charts/lupi/calendar-heat.data.d.ts +20 -0
  360. package/lib/types/charts/lupi/cluster-field.d.ts +21 -0
  361. package/lib/types/charts/lupi/cluster-field.data.d.ts +52 -0
  362. package/lib/types/charts/lupi/dot-cascade.d.ts +22 -0
  363. package/lib/types/charts/lupi/dot-cascade.data.d.ts +24 -0
  364. package/lib/types/charts/lupi/dotty-matrix.d.ts +17 -0
  365. package/lib/types/charts/lupi/dotty-matrix.data.d.ts +32 -0
  366. package/lib/types/charts/lupi/hourglass-stream.d.ts +18 -0
  367. package/lib/types/charts/lupi/hourglass-stream.data.d.ts +27 -0
  368. package/lib/types/charts/lupi/hundred-field.d.ts +18 -0
  369. package/lib/types/charts/lupi/hundred-field.data.d.ts +24 -0
  370. package/lib/types/charts/lupi/launch-fan.d.ts +37 -0
  371. package/lib/types/charts/lupi/launch-fan.data.d.ts +41 -0
  372. package/lib/types/charts/lupi/matrix-heat.d.ts +20 -0
  373. package/lib/types/charts/lupi/matrix-heat.data.d.ts +29 -0
  374. package/lib/types/charts/lupi/parallel-coordinates.d.ts +23 -0
  375. package/lib/types/charts/lupi/parallel-coordinates.data.d.ts +40 -0
  376. package/lib/types/charts/lupi/radial-convergence.d.ts +15 -0
  377. package/lib/types/charts/lupi/radial-convergence.data.d.ts +24 -0
  378. package/lib/types/charts/lupi/radial-patchwork.d.ts +16 -0
  379. package/lib/types/charts/lupi/radial-patchwork.data.d.ts +35 -0
  380. package/lib/types/charts/lupi/ridgeline.d.ts +23 -0
  381. package/lib/types/charts/lupi/ridgeline.data.d.ts +19 -0
  382. package/lib/types/charts/lupi/trend-lineage.d.ts +18 -0
  383. package/lib/types/charts/lupi/trend-lineage.data.d.ts +56 -0
  384. package/lib/types/charts/lupi/type-colonnade.d.ts +20 -0
  385. package/lib/types/charts/lupi/type-colonnade.data.d.ts +30 -0
  386. package/lib/types/charts/lupi/util-a.d.ts +9 -0
  387. package/lib/types/charts/lupi/util-b.d.ts +11 -0
  388. package/lib/types/charts/maps/choropleth.d.ts +33 -0
  389. package/lib/types/charts/maps/geo.d.ts +48 -0
  390. package/lib/types/charts/maps/legend.d.ts +14 -0
  391. package/lib/types/charts/maps/step-fill.d.ts +6 -0
  392. package/lib/types/charts/maps/us-choropleth.d.ts +25 -0
  393. package/lib/types/charts/maps/us-choropleth.data.d.ts +23 -0
  394. package/lib/types/charts/maps/world-choropleth.d.ts +22 -0
  395. package/lib/types/charts/maps/world-choropleth.data.d.ts +35 -0
  396. package/lib/types/charts/markers.d.ts +42 -0
  397. package/lib/types/charts/marks.d.ts +58 -0
  398. package/lib/types/charts/motion.d.ts +12 -0
  399. package/lib/types/charts/originals/daily-users.d.ts +13 -0
  400. package/lib/types/charts/originals/daily-users.data.d.ts +17 -0
  401. package/lib/types/charts/originals/feature-rank.d.ts +13 -0
  402. package/lib/types/charts/originals/feature-rank.data.d.ts +29 -0
  403. package/lib/types/charts/originals/format.d.ts +2 -0
  404. package/lib/types/charts/originals/key.d.ts +16 -0
  405. package/lib/types/charts/originals/response-time.d.ts +11 -0
  406. package/lib/types/charts/originals/response-time.data.d.ts +24 -0
  407. package/lib/types/charts/originals/revenue-by-plan.d.ts +12 -0
  408. package/lib/types/charts/originals/revenue-by-plan.data.d.ts +26 -0
  409. package/lib/types/charts/playback.d.ts +42 -0
  410. package/lib/types/charts/plot-note.d.ts +37 -0
  411. package/lib/types/charts/roles.d.ts +28 -0
  412. package/lib/types/charts/rules.d.ts +62 -0
  413. package/lib/types/charts/scale-context.d.ts +3 -0
  414. package/lib/types/charts/shapes.d.ts +9 -0
  415. package/lib/types/charts/shared-options.d.ts +25 -0
  416. package/lib/types/charts/svg.d.ts +24 -0
  417. package/lib/types/charts/text.d.ts +36 -0
  418. package/lib/types/charts/texture-ids.d.ts +24 -0
  419. package/lib/types/charts/texture.d.ts +185 -0
  420. package/lib/types/charts/util.d.ts +66 -0
  421. package/lib/types/charts/value-grid.d.ts +22 -0
  422. package/lib/types/draw.d.ts +279 -0
  423. package/lib/types/entries/dumbbell-queue.d.ts +2 -0
  424. package/lib/types/entries/hairline-area.d.ts +2 -0
  425. package/lib/types/entries/hairline-line.d.ts +2 -0
  426. package/lib/types/entries/plumb-scatter.d.ts +2 -0
  427. package/lib/types/entries/rung-bars.d.ts +2 -0
  428. package/lib/types/entries/slope.d.ts +2 -0
  429. package/lib/types/frame.d.ts +2 -0
  430. package/lib/types/index.d.ts +82 -0
  431. package/lib/types/kit.d.ts +22 -0
  432. package/lib/types/lib/format.d.ts +58 -0
  433. package/lib/types/lib/random.d.ts +5 -0
  434. package/lib/types/maps.d.ts +2 -0
  435. package/lib/types/schema/daily.d.ts +14 -0
  436. package/lib/types/schema/dumbbell-queue.d.ts +91 -0
  437. package/lib/types/schema/format.d.ts +101 -0
  438. package/lib/types/schema/hairline-area.d.ts +83 -0
  439. package/lib/types/schema/hairline-line.d.ts +85 -0
  440. package/lib/types/schema/key.d.ts +12 -0
  441. package/lib/types/schema/metrics.d.ts +26 -0
  442. package/lib/types/schema/motion.d.ts +22 -0
  443. package/lib/types/schema/options.d.ts +51 -0
  444. package/lib/types/schema/plumb-scatter.d.ts +124 -0
  445. package/lib/types/schema/registry.d.ts +309 -0
  446. package/lib/types/schema/rung-bars.d.ts +84 -0
  447. package/lib/types/schema/scale.d.ts +34 -0
  448. package/lib/types/schema/slope.d.ts +120 -0
  449. package/lib/types/schema/validate.d.ts +29 -0
  450. package/lib/types/schema.d.ts +30 -0
  451. package/lib/types/theme/derive.d.ts +23 -0
  452. package/lib/types/theme.d.ts +2 -0
  453. package/lib/vendor/us-atlas/states-10m.json.js +13855 -0
  454. package/lib/vendor/world-atlas/countries-110m.json.js +9357 -0
  455. package/package.json +162 -4
@@ -0,0 +1,157 @@
1
+ "use client";
2
+ import { Plot as e, Tooltip as t } from "../core.js";
3
+ import { noteOf as n, noteSpace as r, stagger as i } from "../util.js";
4
+ import { DimGroup as a, TipText as o } from "../hover.js";
5
+ import { DOT as s } from "../marks.js";
6
+ import { Ring as c } from "../markers.js";
7
+ import { FootNote as l } from "../plot-note.js";
8
+ import { VRule as u } from "../rules.js";
9
+ import { ChartSvg as d } from "../svg.js";
10
+ import { Label as f } from "../text.js";
11
+ import { labelRoom as p, textWidth as m } from "./util-a.js";
12
+ import { jitterStripDemo as h } from "./jitter-strip.data.js";
13
+ import { useState as g } from "react";
14
+ import { scaleLinear as _ } from "d3-scale";
15
+ import { median as v, tickStep as y } from "d3-array";
16
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
17
+ //#region src/charts/glance/jitter-strip.tsx
18
+ var S = (e) => `${Math.round(e * 10) / 10}`, C = (e) => {
19
+ let t = y(0, e, 4);
20
+ return Array.from({ length: Math.ceil(e / t) + 1 }, (e, n) => n * t);
21
+ }, w = (e, t, n, r, i) => {
22
+ let a = Math.ceil(i / t), o = e.map((e) => Math.max(a, Math.round(e / t))), s = /* @__PURE__ */ new Map();
23
+ for (let e of o) s.set(e, (s.get(e) ?? 0) + 1);
24
+ let c = Math.max(1, ...s.values()), l = Math.min(t, r / c), u = /* @__PURE__ */ new Map();
25
+ return o.map((e) => {
26
+ let r = u.get(e) ?? 0;
27
+ u.set(e, r + 1);
28
+ let i = Math.ceil(r / 2) * (r % 2 == 0 ? -1 : 1);
29
+ return {
30
+ x: e * t,
31
+ y: n + i * l
32
+ };
33
+ });
34
+ }, T = (e) => {
35
+ let t = s[e.dot], n = w(e.group.values.map((t) => e.x(t)), t * 2 + 2, Math.round(e.top + e.band / 2), e.band * .9, e.x(0) + t + 2);
36
+ return /* @__PURE__ */ x(a, {
37
+ dim: e.hover !== null && e.hover.g !== e.g,
38
+ children: [
39
+ /* @__PURE__ */ b(f, {
40
+ className: e.heroRow ? "fill-ink" : void 0,
41
+ dy: "0.35em",
42
+ muted: !e.heroRow,
43
+ voice: "label",
44
+ x: e.labelX,
45
+ y: e.top + e.band / 2,
46
+ children: e.group.label
47
+ }),
48
+ e.group.values.map((r, a) => {
49
+ let o = n[a], s = e.hover !== null && e.hover.g === e.g && e.hover.k === a;
50
+ return /* @__PURE__ */ b(c, {
51
+ className: `pop ${s || e.hero ? "stroke-ink" : "stroke-l4"}`,
52
+ style: i(a, "dense"),
53
+ cx: o.x,
54
+ cy: o.y,
55
+ open: !0,
56
+ size: s ? "lg" : e.dot,
57
+ pointerEvents: "visible",
58
+ onPointerEnter: () => {
59
+ e.onEnter({
60
+ g: e.g,
61
+ k: a,
62
+ x: o.x,
63
+ y: o.y - t - 4
64
+ });
65
+ }
66
+ }, `${e.group.label}-${String(a)}`);
67
+ }),
68
+ e.heroRow ? /* @__PURE__ */ b("line", {
69
+ className: "fade stroke-ink",
70
+ style: i(8 + e.g),
71
+ x1: Math.round(e.x(e.med)),
72
+ x2: Math.round(e.x(e.med)),
73
+ y1: Math.round(e.top + e.band * .04),
74
+ y2: Math.round(e.top + e.band * .96),
75
+ strokeWidth: 2
76
+ }) : /* @__PURE__ */ b("line", {
77
+ className: "fade stroke-rule",
78
+ style: i(8 + e.g),
79
+ x1: Math.round(e.x(e.med)),
80
+ x2: Math.round(e.x(e.med)),
81
+ y1: Math.round(e.top + e.band * .04),
82
+ y2: Math.round(e.top + e.band * .96),
83
+ strokeWidth: 2
84
+ })
85
+ ]
86
+ });
87
+ }, E = (i) => {
88
+ let a = i.data ?? h, s = i.height ?? 420, c = i.format ?? S, y = i.unit ?? "record", w = i.tickFormat ?? c, [E, D] = g(null), O = Math.max(...a.flatMap((e) => e.values)), k = a.map((e) => v(e.values) ?? 0), A = `Jitter strip: ${a.map((e, t) => `${e.label}, ${e.values.length} records, median ${c(k[t])}`).join("; ")}`;
89
+ return /* @__PURE__ */ b(e, {
90
+ overlay: E === null ? null : /* @__PURE__ */ b(t, {
91
+ x: E.x,
92
+ y: E.y,
93
+ children: /* @__PURE__ */ b(o, {
94
+ facts: [`${a[E.g].names?.[E.k] ?? `this ${y}`} ${c(a[E.g].values[E.k])}`, `median ${c(k[E.g])}`],
95
+ lead: a[E.g].label
96
+ })
97
+ }),
98
+ children: (e) => {
99
+ let t = e < 480, o = C(O), c = {
100
+ bottom: 40 + r(n(i), e - 16, 16),
101
+ left: p(a.map((e) => e.label)) + 10,
102
+ right: Math.ceil(m(w(o.at(-1) ?? 0), "t-axis") / 2),
103
+ top: 10
104
+ }, h = _().domain([0, o.at(-1) ?? O]).range([c.left + 6, e - c.right]), g = (s - c.top - c.bottom) / a.length, v = s - c.bottom;
105
+ return /* @__PURE__ */ x(d, {
106
+ height: s,
107
+ label: A,
108
+ leave: () => {
109
+ D(null);
110
+ },
111
+ width: e,
112
+ children: [
113
+ o.map((e) => /* @__PURE__ */ x("g", { children: [/* @__PURE__ */ b(u, {
114
+ kind: e === 0 ? "hairline" : "grid",
115
+ x: h(e),
116
+ y0: c.top,
117
+ y1: v
118
+ }), /* @__PURE__ */ b(f, {
119
+ anchor: "middle",
120
+ voice: "axis",
121
+ x: h(e),
122
+ y: v + 16,
123
+ children: w(e)
124
+ })] }, e)),
125
+ i.axisLabel === void 0 ? null : /* @__PURE__ */ b(f, {
126
+ anchor: "end",
127
+ voice: "axis",
128
+ x: e,
129
+ y: v + 34,
130
+ children: i.axisLabel
131
+ }),
132
+ a.map((e, n) => /* @__PURE__ */ b(T, {
133
+ band: g,
134
+ dot: t ? "sm" : "md",
135
+ hero: i.highlight === n,
136
+ heroRow: (i.highlight ?? 0) === n,
137
+ g: n,
138
+ group: e,
139
+ hover: E,
140
+ labelX: 0,
141
+ med: k[n],
142
+ onEnter: D,
143
+ top: c.top + g * n,
144
+ x: h
145
+ }, e.label)),
146
+ /* @__PURE__ */ b(l, {
147
+ height: s,
148
+ text: n(i),
149
+ width: e
150
+ })
151
+ ]
152
+ });
153
+ }
154
+ });
155
+ };
156
+ //#endregion
157
+ export { E as JitterStrip };
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ //#region src/charts/glance/link-bundle.tsx
4
+ var t = 2, n = (e, t) => {
5
+ let n = Math.hypot(t.x - e.x, t.y - e.y) || 1;
6
+ return {
7
+ x: -(t.y - e.y) / n,
8
+ y: (t.x - e.x) / n
9
+ };
10
+ }, r = (e, t) => e.x * t.y - e.y * t.x, i = (e, t, i, a) => {
11
+ let o = n(e, t), s = n(t, i), c = {
12
+ x: t.x - e.x,
13
+ y: t.y - e.y
14
+ }, l = {
15
+ x: i.x - t.x,
16
+ y: i.y - t.y
17
+ }, u = {
18
+ x: e.x + a * o.x,
19
+ y: e.y + a * o.y
20
+ }, d = {
21
+ x: i.x + a * s.x,
22
+ y: i.y + a * s.y
23
+ }, f = r(c, l), p = Math.abs(f) < 1e-6 ? .5 : r({
24
+ x: d.x - u.x,
25
+ y: d.y - u.y
26
+ }, l) / f, m = Math.abs(f) < 1e-6 ? {
27
+ x: t.x + a * o.x,
28
+ y: t.y + a * o.y
29
+ } : {
30
+ x: u.x + c.x * p,
31
+ y: u.y + c.y * p
32
+ };
33
+ return `M${u.x},${u.y}Q${m.x},${m.y} ${d.x},${d.y}`;
34
+ }, a = (n) => {
35
+ let r = n.q ?? {
36
+ x: (n.s.x + n.t.x) / 2,
37
+ y: (n.s.y + n.t.y) / 2
38
+ }, a = Array.from({ length: n.lines }, (e, r) => (r - (n.lines - 1) / 2) * t);
39
+ return /* @__PURE__ */ e("g", {
40
+ className: n.className,
41
+ fill: "none",
42
+ style: n.style,
43
+ children: a.map((t) => /* @__PURE__ */ e("path", {
44
+ d: i(n.s, r, n.t, t),
45
+ pathLength: 1,
46
+ strokeWidth: 1
47
+ }, t))
48
+ });
49
+ };
50
+ //#endregion
51
+ export { a as LinkBundle };
@@ -0,0 +1,108 @@
1
+ "use client";
2
+ //#region src/charts/glance/matrix-heat-glance.data.ts
3
+ var e = {
4
+ columns: [
5
+ "Car",
6
+ "Tumble dryer",
7
+ "Dishwasher",
8
+ "Computer",
9
+ "Internet",
10
+ "Mobile"
11
+ ],
12
+ rows: [
13
+ "Lowest tenth",
14
+ "2nd",
15
+ "3rd",
16
+ "4th",
17
+ "5th",
18
+ "6th",
19
+ "7th",
20
+ "8th",
21
+ "9th",
22
+ "Highest tenth"
23
+ ],
24
+ values: [
25
+ [
26
+ 40,
27
+ 36,
28
+ 20,
29
+ 63,
30
+ 69,
31
+ 88
32
+ ],
33
+ [
34
+ 54,
35
+ 44,
36
+ 23,
37
+ 70,
38
+ 72,
39
+ 87
40
+ ],
41
+ [
42
+ 65,
43
+ 51,
44
+ 30,
45
+ 83,
46
+ 86,
47
+ 95
48
+ ],
49
+ [
50
+ 79,
51
+ 55,
52
+ 39,
53
+ 87,
54
+ 90,
55
+ 96
56
+ ],
57
+ [
58
+ 84,
59
+ 56,
60
+ 47,
61
+ 94,
62
+ 96,
63
+ 98
64
+ ],
65
+ [
66
+ 93,
67
+ 60,
68
+ 51,
69
+ 96,
70
+ 98,
71
+ 99
72
+ ],
73
+ [
74
+ 92,
75
+ 65,
76
+ 55,
77
+ 97,
78
+ 99,
79
+ 99
80
+ ],
81
+ [
82
+ 93,
83
+ 67,
84
+ 64,
85
+ 99,
86
+ 99,
87
+ 99
88
+ ],
89
+ [
90
+ 94,
91
+ 72,
92
+ 74,
93
+ 99,
94
+ 99,
95
+ 99
96
+ ],
97
+ [
98
+ 92,
99
+ 73,
100
+ 83,
101
+ 100,
102
+ 99,
103
+ 99
104
+ ]
105
+ ]
106
+ };
107
+ //#endregion
108
+ export { e as matrixHeatGlanceDemo };
@@ -0,0 +1,170 @@
1
+ "use client";
2
+ import { Plot as e, Tooltip as t } from "../core.js";
3
+ import { noteOf as n, noteSpace as r, stagger as i } from "../util.js";
4
+ import { DimGroup as a, TipText as o } from "../hover.js";
5
+ import { KEY as s } from "../marks.js";
6
+ import { FootNote as c } from "../plot-note.js";
7
+ import { ChartSvg as l } from "../svg.js";
8
+ import { Label as u } from "../text.js";
9
+ import { HALFTONE_R as d, paint as f, useTextureIds as p } from "../texture-ids.js";
10
+ import { DotScreen as m, KeySwatch as h, PlateLabel as g } from "../texture.js";
11
+ import { labelRoom as _, textWidth as v } from "./util-a.js";
12
+ import { matrixHeatGlanceDemo as y } from "./matrix-heat-glance.data.js";
13
+ import { useState as b } from "react";
14
+ import { scaleQuantize as x } from "d3-scale";
15
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
16
+ //#region src/charts/glance/matrix-heat-glance.tsx
17
+ var w = 2, T = d, E = s.swatch, D = s.gap, O = s.entryGap, k = (e) => Math.max(9, Math.floor((e - 5) / 4) * 4 + 5), A = (e) => `${Math.round(e)}`, j = (e) => /* @__PURE__ */ C(a, {
18
+ className: "pop",
19
+ dim: e.dimmed,
20
+ style: i(e.stagger, "mark"),
21
+ transform: `translate(${e.x} ${e.y})`,
22
+ onPointerEnter: () => {
23
+ e.onEnter();
24
+ },
25
+ children: [/* @__PURE__ */ S("rect", {
26
+ x: .5,
27
+ y: .5,
28
+ width: e.w - 1,
29
+ height: e.h - 1,
30
+ rx: w,
31
+ className: `shape-crisp ${e.hero ? "fill-hero stroke-hero" : "stroke-l5"}`,
32
+ fill: e.hero ? void 0 : e.fill,
33
+ strokeWidth: 1
34
+ }), /* @__PURE__ */ S(g, {
35
+ hero: e.hero,
36
+ text: e.text,
37
+ x: e.w / 2,
38
+ y: e.h / 2
39
+ })]
40
+ }), M = (e) => {
41
+ let t = e.labels.map((e) => Math.ceil(v(e, "t-axis"))), n = (e) => E + D + t[e], r = t.reduce((e, t, r) => e + n(r), 0) + O * (t.length - 1), i = Math.max(0, Math.round(e.right - r)), a = e.labels.map((r, a) => ({
42
+ at: i + t.slice(0, a).reduce((e, t, r) => e + n(r) + O, 0),
43
+ l: r,
44
+ screen: e.screens[a]
45
+ }));
46
+ return /* @__PURE__ */ S("g", {
47
+ className: "fade",
48
+ children: a.map((t) => /* @__PURE__ */ C("g", { children: [/* @__PURE__ */ S(h, {
49
+ fill: t.screen,
50
+ x: t.at,
51
+ y: e.y
52
+ }), /* @__PURE__ */ S(u, {
53
+ dy: "0.35em",
54
+ voice: "axis",
55
+ x: t.at + E + D,
56
+ y: e.y + E / 2,
57
+ children: t.l
58
+ })] }, t.l))
59
+ });
60
+ }, N = (e) => /* @__PURE__ */ S("g", { children: e.data.rows.map((t, n) => {
61
+ let r = e.top + n * (e.pitch + e.gap);
62
+ return /* @__PURE__ */ C("g", { children: [/* @__PURE__ */ S(u, {
63
+ anchor: "end",
64
+ dy: "0.36em",
65
+ muted: !0,
66
+ voice: "label",
67
+ x: e.x0 - e.labelGap,
68
+ y: r + e.pitch / 2,
69
+ children: t
70
+ }), e.data.columns.map((t, i) => {
71
+ let a = e.x0 + i * (e.cell + e.gap);
72
+ return /* @__PURE__ */ S(j, {
73
+ dimmed: e.hover !== null && (e.hover.r !== n || e.hover.c !== i),
74
+ fill: e.fillOf(n, i),
75
+ h: e.pitch,
76
+ hero: n === e.hero[0] && i === e.hero[1],
77
+ onEnter: () => {
78
+ e.onHover({
79
+ c: i,
80
+ r: n,
81
+ x: a + e.cell / 2,
82
+ y: r - 4
83
+ });
84
+ },
85
+ stagger: n + i,
86
+ text: e.format(e.data.values[n][i]),
87
+ w: e.cell,
88
+ x: a,
89
+ y: r
90
+ }, t);
91
+ })] }, t);
92
+ }) }), P = (e) => x().domain(e).range([
93
+ 0,
94
+ 1,
95
+ 2,
96
+ 3,
97
+ 4
98
+ ]), F = (e, t) => T.map((n, r) => {
99
+ let [i, a] = P(e).invertExtent(r);
100
+ return `${t(i)}–${t(a)}${r === T.length - 1 ? "%" : ""}`;
101
+ }), I = (e) => {
102
+ let t = [0, 0];
103
+ for (let [n, r] of e.entries()) for (let [i, a] of r.entries()) a > e[t[0]][t[1]] && (t = [n, i]);
104
+ return t;
105
+ }, L = (i) => {
106
+ let a = i.data ?? y, s = i.format ?? A, d = i.unit ?? "% of households", h = a.rows.length, g = a.columns.length, x = i.domain ?? [0, 100], w = P(x), [D, O] = i.highlight ?? I(a.values), [j, L] = b(null), R = p("heat"), z = T.map((e, t) => f(R(`s${t}`))), B = F(x, s), V = `Matrix of ${h} by ${g}: ${a.rows.map((e, t) => `${e}: ${a.values[t].map((e, t) => `${a.columns[t]} ${s(e)}`).join(", ")}`).join("; ")}`;
107
+ return /* @__PURE__ */ S(e, {
108
+ overlay: j === null ? null : /* @__PURE__ */ S(t, {
109
+ x: j.x,
110
+ y: j.y,
111
+ children: /* @__PURE__ */ S(o, {
112
+ facts: [`${s(a.values[j.r][j.c])}${d}`],
113
+ lead: `${a.rows[j.r]} · ${a.columns[j.c]}`
114
+ })
115
+ }),
116
+ children: (e) => {
117
+ let t = e < 480, o = t ? 5 : 10, d = t ? 8 : 16, f = _(a.rows), p = k(Math.min(80, (e - f - d - o * (g - 1)) / g)), y = p * g + o * (g - 1), b = Math.round((e - f - d - y) / 2 + f + d), x = Math.max(...a.columns.map((e) => v(e, "t-label"))) > p, A = x ? 40 : 26, P = k(Math.min(p * .86, 76)), F = A + h * P + o * (h - 1) + 18, I = i.height ?? F + E + 6 + r(n(i), e - 16, 30);
118
+ return /* @__PURE__ */ C(l, {
119
+ height: I,
120
+ label: V,
121
+ leave: () => {
122
+ L(null);
123
+ },
124
+ width: e,
125
+ children: [
126
+ /* @__PURE__ */ S("defs", { children: T.map((e, t) => /* @__PURE__ */ S(m, {
127
+ id: R(`s${t}`),
128
+ r: e,
129
+ tone: "fill-l3"
130
+ }, e)) }),
131
+ a.columns.map((e, t) => /* @__PURE__ */ S(u, {
132
+ anchor: "middle",
133
+ muted: !0,
134
+ voice: "label",
135
+ x: b + t * (p + o) + p / 2,
136
+ y: A - 12 - (x && t % 2 == 0 ? 14 : 0),
137
+ children: e
138
+ }, e)),
139
+ /* @__PURE__ */ S(N, {
140
+ cell: p,
141
+ data: a,
142
+ fillOf: (e, t) => e === D && t === O ? "" : z[w(a.values[e][t])],
143
+ format: s,
144
+ gap: o,
145
+ hero: [D, O],
146
+ hover: j,
147
+ labelGap: d,
148
+ onHover: L,
149
+ pitch: P,
150
+ top: A,
151
+ x0: b
152
+ }),
153
+ /* @__PURE__ */ S(M, {
154
+ labels: B,
155
+ right: b + y,
156
+ screens: z,
157
+ y: F
158
+ }),
159
+ /* @__PURE__ */ S(c, {
160
+ height: I,
161
+ text: n(i),
162
+ width: e
163
+ })
164
+ ]
165
+ });
166
+ }
167
+ });
168
+ };
169
+ //#endregion
170
+ export { L as MatrixHeatGlance };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ //#region src/charts/glance/pictorial-bar.data.ts
3
+ var e = [
4
+ {
5
+ label: "Les Misérables",
6
+ value: 565
7
+ },
8
+ {
9
+ label: "War and Peace",
10
+ value: 563
11
+ },
12
+ {
13
+ label: "Don Quixote",
14
+ value: 427
15
+ },
16
+ {
17
+ label: "Middlemarch",
18
+ value: 316
19
+ }
20
+ ];
21
+ //#endregion
22
+ export { e as pictorialBarDemo };
@@ -0,0 +1,180 @@
1
+ "use client";
2
+ import { useHover as e, useSvgId as t } from "../hooks.js";
3
+ import { Plot as n, Tooltip as r } from "../core.js";
4
+ import { noteOf as i, noteSpace as a, stagger as o } from "../util.js";
5
+ import { DimGroup as s, HitRect as c, TipText as l } from "../hover.js";
6
+ import { FootNote as u } from "../plot-note.js";
7
+ import { ChartSvg as d } from "../svg.js";
8
+ import { Label as f } from "../text.js";
9
+ import { paint as p, useTextureIds as m } from "../texture-ids.js";
10
+ import { Hatch as h } from "../texture.js";
11
+ import { labelRoom as g, rankTones as _ } from "./util-a.js";
12
+ import { pictorialBarDemo as v } from "./pictorial-bar.data.js";
13
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
14
+ //#region src/charts/glance/pictorial-bar.tsx
15
+ var S = 4, C = 18, w = 24, T = 7.5 / 18, E = (e) => g(e.map((e) => e.label), "t-label") + 18, D = (e, t, n, r) => t + Math.max(0, Math.floor((e - t - n - 10 - r - 4) / 2)), O = (e, t) => g(e.map((e) => t(e.value)), "t-value"), k = (e) => `${e}k words`, A = (e, t) => {
16
+ let n = Math.max(2, Math.round(e * T)), r = e - .5, i = t - .5;
17
+ return {
18
+ body: `M0.5 0.5H${r - n}L${r} ${.5 + n}V${i}H0.5Z`,
19
+ fold: `M${r - n} 0.5V${.5 + n}H${r}`
20
+ };
21
+ }, j = (e) => {
22
+ let t = A(e.w, e.h);
23
+ return /* @__PURE__ */ x("g", {
24
+ className: `${e.tone} shape-crisp`,
25
+ fill: "none",
26
+ strokeLinejoin: "round",
27
+ strokeWidth: 1,
28
+ transform: `translate(${e.x} ${e.y})`,
29
+ children: [/* @__PURE__ */ b("path", {
30
+ className: e.fill === void 0 ? "fill-paper" : void 0,
31
+ d: t.body,
32
+ fill: e.fill
33
+ }), /* @__PURE__ */ b("path", { d: t.fold })]
34
+ });
35
+ }, M = ({ row: e, g: t, hero: n, id: r, texture: i, width: a, dim: o, label: l, onEnter: u }) => {
36
+ let d = Math.round(e.cy - (t.lines * t.ih + (t.lines - 1) * S) / 2), p = Array.from({ length: t.slots }, (n, r) => ({
37
+ id: `${e.datum.label}-${r}`,
38
+ x: Math.round(t.x0 + r % t.perLine * t.pitch + (t.pitch - t.iw) / 2),
39
+ y: d + Math.floor(r / t.perLine) * (t.ih + S)
40
+ }));
41
+ return /* @__PURE__ */ x(s, {
42
+ dim: o,
43
+ onPointerEnter: u,
44
+ children: [
45
+ /* @__PURE__ */ b(c, {
46
+ x: 0,
47
+ y: e.cy - t.rowH / 2,
48
+ width: a,
49
+ height: t.rowH
50
+ }),
51
+ /* @__PURE__ */ b(f, {
52
+ anchor: "end",
53
+ dy: "0.35em",
54
+ muted: !0,
55
+ voice: "label",
56
+ x: t.x0 - 14,
57
+ y: e.cy,
58
+ children: e.datum.label
59
+ }),
60
+ /* @__PURE__ */ b("g", { children: p.map((e) => /* @__PURE__ */ b(j, {
61
+ h: t.ih,
62
+ tone: "stroke-l5",
63
+ w: t.iw,
64
+ x: e.x,
65
+ y: e.y
66
+ }, e.id)) }),
67
+ /* @__PURE__ */ b("g", {
68
+ clipPath: `url(#${r}-c${e.i})`,
69
+ children: p.map((e) => /* @__PURE__ */ b(j, {
70
+ fill: i,
71
+ h: t.ih,
72
+ tone: n ? "stroke-ink" : "stroke-l3",
73
+ w: t.iw,
74
+ x: e.x,
75
+ y: e.y
76
+ }, e.id))
77
+ }),
78
+ /* @__PURE__ */ b(f, {
79
+ dy: "0.35em",
80
+ muted: !n,
81
+ order: e.i + 4,
82
+ tier: "series",
83
+ voice: "value",
84
+ x: t.x0 + t.perLine * t.pitch + 10,
85
+ y: e.cy,
86
+ children: l
87
+ })
88
+ ]
89
+ });
90
+ }, N = (e) => {
91
+ let t = e.g.lines * e.g.ih + (e.g.lines - 1) * S;
92
+ return /* @__PURE__ */ b(y, { children: e.rows.map((n) => /* @__PURE__ */ b("clipPath", {
93
+ id: `${e.id}-c${n.i}`,
94
+ children: n.cuts.map((r, i) => /* @__PURE__ */ b("rect", {
95
+ className: "grow-x",
96
+ style: o(n.i + i, "series"),
97
+ x: e.g.x0,
98
+ y: n.cy - t / 2 + i * (e.g.ih + S) - 1,
99
+ width: r - e.g.x0,
100
+ height: e.g.ih + 2
101
+ }, `line-${String(i)}`))
102
+ }, n.datum.label)) });
103
+ }, P = (o) => {
104
+ let s = o.data ?? v, c = o.unit ?? 50, f = o.height ?? 320, g = o.format ?? k, y = t("pict"), T = m("pict"), A = e(), j = _(s.map((e) => e.value), [0, 4]), P = (e) => o.highlight === void 0 ? j[e] === 0 : o.highlight === e, F = Math.ceil(Math.max(...s.map((e) => e.value)) / c), I = `One page = ${c}k words. ${s.map((e) => `${e.label} ${g(e.value)}`).join(", ")}`;
105
+ return /* @__PURE__ */ b(n, {
106
+ overlay: A.at === null ? null : /* @__PURE__ */ b(r, {
107
+ x: A.at.x,
108
+ y: A.at.y,
109
+ children: /* @__PURE__ */ b(l, {
110
+ facts: [g(s[A.at.key].value)],
111
+ lead: s[A.at.key].label
112
+ })
113
+ }),
114
+ children: (e) => {
115
+ let t = E(s), n = O(s, g), r = Math.max(48, n + 18), l = e < 460 ? 2 : 1, m = Math.ceil(F / l), _ = Math.min(30, (e - t - r) / m), v = D(e, t, m * _, n), k = Math.min(1.1, _ * .82 / C), j = a(i(o), e - 16, 22), L = Math.min((f - 16 - j) / s.length, e < 460 ? 64 : Infinity), R = 16 + L * s.length + j, z = {
116
+ ih: Math.round(w * k),
117
+ iw: Math.round(C * k),
118
+ lines: l,
119
+ perLine: m,
120
+ pitch: _,
121
+ rowH: L,
122
+ slots: F,
123
+ x0: v
124
+ }, B = s.map((e, t) => {
125
+ let n = e.value / c;
126
+ return {
127
+ cuts: Array.from({ length: l }, (e, t) => {
128
+ let r = Math.max(0, Math.min(m, n - t * m)), i = Math.floor(r);
129
+ return r >= m ? v + m * _ : Math.round(v + i * _ + (_ - z.iw) / 2 + (r - i) * z.iw);
130
+ }),
131
+ cy: 8 + (t + .5) * z.rowH,
132
+ datum: e,
133
+ i: t,
134
+ n
135
+ };
136
+ });
137
+ return /* @__PURE__ */ x(d, {
138
+ height: R,
139
+ label: I,
140
+ leave: A.clear,
141
+ width: e,
142
+ children: [
143
+ /* @__PURE__ */ x("defs", { children: [
144
+ /* @__PURE__ */ b(h, {
145
+ id: T("row"),
146
+ tone: "fill-l3"
147
+ }),
148
+ /* @__PURE__ */ b(h, {
149
+ id: T("hero"),
150
+ tone: "fill-hero"
151
+ }),
152
+ /* @__PURE__ */ b(N, {
153
+ g: z,
154
+ id: y,
155
+ rows: B
156
+ })
157
+ ] }),
158
+ B.map((t) => /* @__PURE__ */ b(M, {
159
+ row: t,
160
+ g: z,
161
+ hero: P(t.i),
162
+ id: y,
163
+ texture: p(T(P(t.i) ? "hero" : "row")),
164
+ width: e,
165
+ dim: A.dim(t.i),
166
+ label: g(t.datum.value),
167
+ onEnter: A.enter(t.i, v + Math.min(t.n, m) * _, t.cy - (l * z.ih + (l - 1) * S) / 2 - 4)
168
+ }, t.datum.label)),
169
+ /* @__PURE__ */ b(u, {
170
+ height: R,
171
+ text: i(o),
172
+ width: e
173
+ })
174
+ ]
175
+ });
176
+ }
177
+ });
178
+ };
179
+ //#endregion
180
+ export { P as PictorialBar };