@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,195 @@
1
+ "use client";
2
+ import { axisFormat as e, dayTickLabels as t, fmtInt as n, plural as r } from "../../lib/format.js";
3
+ import { resolveDateFormat as i, resolveFormat as a } from "../../schema/format.js";
4
+ import { useHover as o } from "../hooks.js";
5
+ import { Plot as s, Tooltip as c } from "../core.js";
6
+ import { noteOf as l, stagger as u } from "../util.js";
7
+ import { TipText as d } from "../hover.js";
8
+ import { crisp as f } from "../axes.js";
9
+ import { Dot as p, Ring as m } from "../markers.js";
10
+ import { FootNote as h } from "../plot-note.js";
11
+ import { HRule as g, Stem as _, VRule as v } from "../rules.js";
12
+ import { chartTable as y, plotOptions as b, pointerX as ee, scoped as x } from "../shared-options.js";
13
+ import { ChartSvg as te } from "../svg.js";
14
+ import { Label as S, XLabels as C } from "../text.js";
15
+ import { TEXTURE_PITCH as w } from "../texture-ids.js";
16
+ import { DottedLine as T } from "../texture.js";
17
+ import { ValueGrid as ne } from "../value-grid.js";
18
+ import { DailyEmpty as E } from "./daily-empty.js";
19
+ import { heroOf as D, isLive as O, reactKeyOf as k, readingRows as A, readingsOf as j, seriesOf as M, valueAt as N } from "./daily-readings.js";
20
+ import { dailyFloor as P, isWeekend as F } from "./util-a.js";
21
+ import { scaleLinear as I } from "d3-scale";
22
+ import { jsx as L, jsxs as R } from "react/jsx-runtime";
23
+ import { line as z } from "d3-shape";
24
+ //#region src/charts/basics/hairline-line.tsx
25
+ var B = 864e5, V = (e, t) => t ? "fill-hero" : e ? "stroke-l3" : "fill-l3", H = ({ format: e, frame: t, hero: n, hover: r, live: i, readings: a }) => {
26
+ let o = i.at(-1) ?? 0, s = (e) => e === n || r === e ? "md" : "sm", c = n === o || n < 0 ? [o] : [n, o];
27
+ return /* @__PURE__ */ R("g", { children: [i.map((e) => {
28
+ let r = e !== n && F(a[e].date), i = {
29
+ className: `pop transition-radius ${V(r, e === n)}`,
30
+ cx: f(t.x(e)),
31
+ cy: t.y(N(a, e)),
32
+ size: s(e),
33
+ style: u(e, "mark")
34
+ }, o = k(a[e], e);
35
+ return L(r ? m : p, { ...i }, o);
36
+ }), c.map((r) => /* @__PURE__ */ L(S, {
37
+ anchor: "middle",
38
+ order: o,
39
+ tier: "mark",
40
+ voice: r === n ? "value" : "axis",
41
+ x: t.x(r),
42
+ y: t.y(N(a, r)) - 12,
43
+ children: e(N(a, r))
44
+ }, k(a[r], r)))] });
45
+ }, U = ({ floor: e, frame: t, hero: n, live: r, readings: i }) => /* @__PURE__ */ L("g", { children: r.map((r) => {
46
+ let a = t.x(r), o = k(i[r], r);
47
+ return r === n ? /* @__PURE__ */ L(_, {
48
+ className: "grow-y stroke-hero",
49
+ hero: !0,
50
+ style: u(r, "mark"),
51
+ x: a,
52
+ y0: Math.round(e),
53
+ y1: t.y(N(i, r))
54
+ }, o) : F(i[r].date) ? /* @__PURE__ */ L("g", {
55
+ className: "fade",
56
+ style: u(r, "mark"),
57
+ children: /* @__PURE__ */ L(T, {
58
+ pitch: w.dense,
59
+ tone: "fill-l4",
60
+ x0: a,
61
+ x1: a,
62
+ y0: t.y(N(i, r)) + 6,
63
+ y1: e - 2
64
+ })
65
+ }, o) : null;
66
+ }) }), W = ({ frame: e, readings: n }) => {
67
+ let r = n.flatMap((e, t) => e.date.getUTCDay() === 1 ? [t] : []), i = t(r.map((e) => n[e].date));
68
+ return /* @__PURE__ */ L(C, {
69
+ ticks: r.map((t, n) => ({
70
+ label: i[n],
71
+ x: e.x(t)
72
+ })),
73
+ y: e.floor + 20
74
+ });
75
+ }, G = (e, t) => z().defined(O).x((e, n) => f(t.x(n))).y((e) => t.y(e.value ?? 0))(e) ?? "", K = (e, t, n, r) => {
76
+ let i = t;
77
+ for (let t of e) Math.abs(n(t) - r) < Math.abs(n(i) - r) && (i = t);
78
+ return i;
79
+ }, q = 1e-290, J = ({ clear: t, emphasis: n, extreme: i, fmtDate: a, format: o, height: s, hover: c, metrics: l, note: u, readings: d, show: p, title: m, wholeNumbers: _, width: y }) => {
80
+ let b = M(d), { live: x } = b, S = P(s, u, y, l);
81
+ if (x.length === 0) return /* @__PURE__ */ L(E, {
82
+ floor: S,
83
+ height: s,
84
+ name: m,
85
+ width: y
86
+ });
87
+ let C = x.map((e) => N(d, e)), w = Math.min(...C), T = Math.max(...C), O = x[C.indexOf(T)], k = x[C.indexOf(w)], A = x.at(-1) ?? 0, [j] = x, F = D(d, x, n, {
88
+ peak: O,
89
+ trough: k
90
+ }[i]), z = Math.min(y - 16, 680), V = Math.round((y - z) / 2), J = V + z, Y = T - w, X = I().domain(Y < q ? [w - 1, T + 1] : [w - Y * .25, T]).nice(5).range([S, 40]), re = d[0].date.getTime(), Z = (e) => Math.round((d[e].date.getTime() - re) / B), Q = I().domain([0, Math.max(1, Z(d.length - 1))]).range([V + 8, J - 48]), $ = {
91
+ floor: S,
92
+ x: (e) => Q(Z(e)),
93
+ x0: V,
94
+ x1: J,
95
+ y: X
96
+ }, ie = G(d, $), ae = `Daily values, ${a(d[j].date)} to ${a(d[A].date)}: high ${o(T)} on ${a(d[O].date)}, low ${o(w)} on ${a(d[k].date)}, latest ${o(N(d, A))}`, oe = `${r(x.length, "reading")}. High ${o(T)} on ${a(d[O].date)}, low ${o(w)} on ${a(d[k].date)}. The data table lists every reading.`;
97
+ return /* @__PURE__ */ R(te, {
98
+ className: "touch-pan-y",
99
+ height: s,
100
+ desc: oe,
101
+ label: m ?? ae,
102
+ leave: t,
103
+ onPointerMove: (e) => {
104
+ let t = ee(e, y), n = K(x, j, Z, Q.invert(t));
105
+ p(n, $.x(n), $.y(N(d, n)) - 16);
106
+ },
107
+ width: y,
108
+ children: [
109
+ /* @__PURE__ */ L(ne, {
110
+ labelFloor: !0,
111
+ side: "right",
112
+ floor: S,
113
+ format: e(o, _, X.ticks(5)),
114
+ ticks: X.ticks(5),
115
+ x0: V,
116
+ x1: J,
117
+ y: X
118
+ }),
119
+ /* @__PURE__ */ L(g, {
120
+ x0: V,
121
+ x1: J,
122
+ y: S
123
+ }),
124
+ /* @__PURE__ */ L(U, {
125
+ floor: S,
126
+ frame: $,
127
+ hero: F,
128
+ ...b
129
+ }),
130
+ c === null || c === F ? null : /* @__PURE__ */ L(v, {
131
+ kind: "rule",
132
+ x: $.x(c),
133
+ y0: $.y(N(d, c)),
134
+ y1: f(S)
135
+ }),
136
+ /* @__PURE__ */ L("path", {
137
+ className: "draw stroke-l3 stroke-medium cap-round fill-none",
138
+ d: ie,
139
+ pathLength: 1
140
+ }),
141
+ /* @__PURE__ */ L(H, {
142
+ format: o,
143
+ frame: $,
144
+ hero: F,
145
+ hover: c,
146
+ ...b
147
+ }),
148
+ /* @__PURE__ */ L(W, {
149
+ frame: $,
150
+ readings: d
151
+ }),
152
+ /* @__PURE__ */ L(h, {
153
+ gutter: 12,
154
+ height: s,
155
+ metrics: l,
156
+ text: u,
157
+ width: y
158
+ })
159
+ ]
160
+ });
161
+ }, Y = (e) => {
162
+ let t = j(e.data ?? []), r = e.format === void 0 ? n : a(e.format), u = i(e.dateFormat), { at: f, clear: p, key: m, show: h } = o(), g = f === null ? void 0 : t[f.key];
163
+ return /* @__PURE__ */ L(s, {
164
+ initialWidth: e.initialWidth,
165
+ width: e.width,
166
+ ...b(e),
167
+ table: y(e, e.title ?? "Daily values", ["Date", "Value"], A(t, u, r)),
168
+ overlay: f === null || g === void 0 ? null : /* @__PURE__ */ L(c, {
169
+ x: f.x,
170
+ y: f.y,
171
+ children: /* @__PURE__ */ L(d, {
172
+ facts: [r(g.value ?? 0), ...F(g.date) ? ["weekend"] : []],
173
+ lead: u(g.date)
174
+ })
175
+ }),
176
+ children: (n) => /* @__PURE__ */ L(J, {
177
+ clear: p,
178
+ emphasis: e.emphasis,
179
+ extreme: e.extreme ?? "peak",
180
+ fmtDate: u,
181
+ format: r,
182
+ height: e.height ?? 440,
183
+ hover: m,
184
+ metrics: e.metrics,
185
+ note: l(e),
186
+ readings: t,
187
+ show: h,
188
+ title: e.title,
189
+ wholeNumbers: e.format === void 0,
190
+ width: n
191
+ })
192
+ });
193
+ }, X = (e) => x(e.idPrefix, /* @__PURE__ */ L(Y, { ...e }));
194
+ //#endregion
195
+ export { X as HairlineLine };
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ //#region src/charts/basics/nested-treemap.data.ts
3
+ var e = [
4
+ {
5
+ children: [{
6
+ name: "Drinking milk",
7
+ value: 6035
8
+ }],
9
+ name: "Liquid"
10
+ },
11
+ {
12
+ children: [
13
+ {
14
+ name: "Cheddar",
15
+ value: 3372
16
+ },
17
+ {
18
+ name: "Territorials",
19
+ value: 362
20
+ },
21
+ {
22
+ name: "Blue vein",
23
+ value: 84
24
+ },
25
+ {
26
+ name: "Other cheese",
27
+ value: 965
28
+ }
29
+ ],
30
+ name: "Cheese"
31
+ },
32
+ {
33
+ children: [
34
+ {
35
+ name: "Butter",
36
+ value: 409
37
+ },
38
+ {
39
+ name: "Cream",
40
+ value: 437
41
+ },
42
+ {
43
+ name: "Yoghurt",
44
+ value: 522
45
+ },
46
+ {
47
+ name: "Condensed milk",
48
+ value: 329
49
+ }
50
+ ],
51
+ name: "Other"
52
+ }
53
+ ];
54
+ //#endregion
55
+ export { e as nestedTreemapDemo };
@@ -0,0 +1,191 @@
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 { sansWidth as i, stagger as a, sum as o } from "../util.js";
6
+ import { DimGroup as s, TipText as c } from "../hover.js";
7
+ import { ChartSvg as l } from "../svg.js";
8
+ import { Label as u } from "../text.js";
9
+ import { maxIndex as d } from "./util-b.js";
10
+ import { paint as f, useTextureIds as p } from "../texture-ids.js";
11
+ import { Hatch as m, PlateLabel as h, Rules as g, Stipple as _ } from "../texture.js";
12
+ import { nestedTreemapDemo as v } from "./nested-treemap.data.js";
13
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
14
+ import { hierarchy as S, treemap as C, treemapDice as w, treemapSquarify as T } from "d3-hierarchy";
15
+ //#region src/charts/basics/nested-treemap.tsx
16
+ var E = 30, D = 1, O = [
17
+ "stipple",
18
+ "hatch",
19
+ "rules"
20
+ ], k = (e, t) => O[Math.max(0, e.findIndex((e) => e.name === t)) % O.length] ?? "stipple", A = (e) => /* @__PURE__ */ x("defs", { children: [
21
+ /* @__PURE__ */ b(_, {
22
+ id: e.ids("stipple"),
23
+ tone: "fill-l3"
24
+ }),
25
+ /* @__PURE__ */ b(m, {
26
+ id: e.ids("hatch"),
27
+ tone: "fill-l4"
28
+ }),
29
+ /* @__PURE__ */ b(g, {
30
+ id: e.ids("rules"),
31
+ tone: "fill-l4"
32
+ })
33
+ ] }), j = (e, t, n) => {
34
+ let r = e < 520, i = T.ratio(1.2), a = n.map((e) => ({
35
+ children: e.children.toSorted((e, t) => t.value - e.value),
36
+ name: e.name,
37
+ total: o(e.children.map((e) => e.value))
38
+ })).toSorted((e, t) => t.total - e.total), s = S({
39
+ children: a,
40
+ name: "root"
41
+ }).sum((e) => e.value ?? 0), c = C().size([e, t]).tile((e, t, n, a, o) => {
42
+ e.depth === 0 && !r ? w(e, t, n, a, o) : i(e, t, n, a, o);
43
+ }).paddingInner((e) => e.depth === 0 ? r ? 12 : 18 : r ? 4 : 7).paddingTop((e) => e.depth === 1 ? E : 0).round(!0)(s), l = c.value ?? 1;
44
+ return {
45
+ bands: (c.children ?? []).map((e) => ({
46
+ name: e.data.name,
47
+ share: (e.value ?? 0) / l,
48
+ x: e.x0 + D,
49
+ y: e.y0 + E - 12
50
+ })),
51
+ tiles: c.leaves().map((e) => {
52
+ let t = e.parent?.data.name ?? "";
53
+ return {
54
+ group: t,
55
+ h: e.y1 - e.y0,
56
+ id: `${t}/${e.data.name}`,
57
+ name: e.data.name,
58
+ value: e.value ?? 0,
59
+ w: e.x1 - e.x0,
60
+ x: e.x0,
61
+ y: e.y0
62
+ };
63
+ })
64
+ };
65
+ }, M = (e) => e.w < 48 || e.h < 48 ? 2 : 4, N = (e) => {
66
+ let t = i(e.name, 12);
67
+ return e.w >= t + 20 && e.h >= 36 ? "across" : e.h >= t + 20 && e.w >= 20 ? "up" : "none";
68
+ }, P = 15, F = 8, I = (e) => {
69
+ let { tile: t } = e, n = N(t), r = e.format(t.value), o = i(r, 11);
70
+ if (n === "none") return null;
71
+ let s = t.x + F, c = t.y + F;
72
+ if (n === "up") return /* @__PURE__ */ b("g", {
73
+ className: "fade",
74
+ style: a(e.index, "series"),
75
+ transform: `translate(${s} ${c}) rotate(-90)`,
76
+ children: /* @__PURE__ */ b(h, {
77
+ anchor: "end",
78
+ className: "t-label",
79
+ hero: e.hero,
80
+ text: t.name,
81
+ x: 0,
82
+ y: P / 2
83
+ })
84
+ });
85
+ let l = t.h >= 52 && t.w >= o + 20;
86
+ return /* @__PURE__ */ x("g", {
87
+ className: "fade",
88
+ style: a(e.index, "series"),
89
+ children: [/* @__PURE__ */ b(h, {
90
+ anchor: "start",
91
+ className: "t-label",
92
+ hero: e.hero,
93
+ text: t.name,
94
+ x: s,
95
+ y: c + P / 2
96
+ }), l ? /* @__PURE__ */ b(h, {
97
+ anchor: "start",
98
+ className: "t-axis",
99
+ hero: e.hero,
100
+ text: r,
101
+ x: s,
102
+ y: c + P + P / 2
103
+ }) : null]
104
+ });
105
+ }, L = (e) => {
106
+ let { tile: t } = e, n = {
107
+ height: t.h - 1,
108
+ rx: M(t),
109
+ style: a(e.index, "series"),
110
+ width: t.w - 1,
111
+ x: t.x + .5,
112
+ y: t.y + .5
113
+ };
114
+ return /* @__PURE__ */ x(y, { children: [
115
+ /* @__PURE__ */ b("rect", {
116
+ ...n,
117
+ className: `grow-y from-top ${e.hero ? "fill-hero" : ""}`,
118
+ fill: e.hero ? void 0 : e.fill
119
+ }),
120
+ e.children,
121
+ /* @__PURE__ */ b("rect", {
122
+ ...n,
123
+ className: `grow-y from-top shape-crisp fill-none ${e.hero ? "stroke-hero" : "stroke-l5"}`,
124
+ strokeWidth: 1
125
+ })
126
+ ] });
127
+ }, R = (i) => {
128
+ let a = i.data ?? v, m = i.height ?? 420, h = i.format ?? e, g = t(), _ = p("tree"), y = o(a.flatMap((e) => e.children.map((e) => e.value))), S = a.flatMap((e) => e.children.map((t) => ({
129
+ group: e.name,
130
+ id: `${e.name}/${t.name}`,
131
+ name: t.name,
132
+ value: t.value
133
+ }))), C = g.key === null ? void 0 : S.find((e) => e.id === g.key), w = a.map((e) => `${e.name}: ${e.children.map((e) => `${e.name} ${h(e.value)}`).join(", ")}`).join("; ");
134
+ return /* @__PURE__ */ b(n, {
135
+ overlay: g.at === null || C === void 0 ? null : /* @__PURE__ */ b(r, {
136
+ x: g.at.x,
137
+ y: g.at.y,
138
+ children: /* @__PURE__ */ b(c, {
139
+ facts: [
140
+ h(C.value),
141
+ `${Math.round(C.value / y * 100)}% of all`,
142
+ C.group
143
+ ],
144
+ lead: C.name
145
+ })
146
+ }),
147
+ children: (e) => {
148
+ let { bands: t, tiles: n } = j(e, m, a), r = i.highlight === void 0 ? n[d(n.map((e) => e.value))]?.id : n.find((e) => e.id === i.highlight || e.name === i.highlight)?.id;
149
+ return /* @__PURE__ */ x(l, {
150
+ height: m,
151
+ label: w,
152
+ leave: g.clear,
153
+ width: e,
154
+ children: [
155
+ /* @__PURE__ */ b(A, { ids: _ }),
156
+ t.map((e, t) => /* @__PURE__ */ x(u, {
157
+ order: t,
158
+ tier: "series",
159
+ voice: "label",
160
+ x: e.x,
161
+ y: e.y,
162
+ children: [
163
+ e.name,
164
+ " · ",
165
+ Math.round(e.share * 100),
166
+ "%"
167
+ ]
168
+ }, e.name)),
169
+ n.map((e, n) => /* @__PURE__ */ b(s, {
170
+ dim: g.dim(e.id),
171
+ onPointerEnter: g.enter(e.id, e.x + e.w / 2, e.y + 10),
172
+ children: /* @__PURE__ */ b(L, {
173
+ fill: f(_(k(t, e.group))),
174
+ hero: r === e.id,
175
+ index: n,
176
+ tile: e,
177
+ children: /* @__PURE__ */ b(I, {
178
+ format: h,
179
+ hero: r === e.id,
180
+ index: n,
181
+ tile: e
182
+ })
183
+ })
184
+ }, e.id))
185
+ ]
186
+ });
187
+ }
188
+ });
189
+ };
190
+ //#endregion
191
+ export { R as NestedTreemap };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ //#region src/charts/basics/paired-rungs.data.ts
3
+ var e = [
4
+ {
5
+ current: 45.1,
6
+ label: "Driving",
7
+ previous: 54.5
8
+ },
9
+ {
10
+ current: 31.2,
11
+ label: "At home",
12
+ previous: 10.3
13
+ },
14
+ {
15
+ current: 7.6,
16
+ label: "On foot",
17
+ previous: 9.8
18
+ },
19
+ {
20
+ current: 4.2,
21
+ label: "Bus",
22
+ previous: 7.2
23
+ },
24
+ {
25
+ current: 1.9,
26
+ label: "Train",
27
+ previous: 5
28
+ }
29
+ ];
30
+ //#endregion
31
+ export { e as pairedRungsDemo };
@@ -0,0 +1,151 @@
1
+ "use client";
2
+ import { useHover as e } from "../hooks.js";
3
+ import { Plot as t, Tooltip as n } from "../core.js";
4
+ import { hasText as r, noteLines as i, noteOf as a, stagger as o } 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 { HRule as d } from "../rules.js";
8
+ import { ChartSvg as f } from "../svg.js";
9
+ import { Label as p } from "../text.js";
10
+ import { maxIndex as m } from "./util-b.js";
11
+ import { paint as h, useTextureIds as g } from "../texture-ids.js";
12
+ import { Hatch as _, Rules as v } from "../texture.js";
13
+ import { rungPitch as y, rungY as b } from "./rung-geometry.js";
14
+ import { Rungs as x } from "./rungs.js";
15
+ import { pairedRungsDemo as S } from "./paired-rungs.data.js";
16
+ import { SeriesKey as C } from "./series-key.js";
17
+ import { scaleBand as w } from "d3-scale";
18
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
19
+ //#region src/charts/basics/paired-rungs.tsx
20
+ var D = ({ bw: e, hatch: t, datum: n, dim: r, floor: i, format: a, gap: l, hero: u, index: d, left: f, onEnter: m, pitch: g, unit: _ }) => {
21
+ let v = Math.round(n.previous / _), y = Math.round(n.current / _), S = b(i, Math.max(v, y) - 1, g) - 26, C = e * 2 + l, w = b(i, v - 1, g);
22
+ return /* @__PURE__ */ E(s, {
23
+ dim: r,
24
+ onPointerEnter: () => {
25
+ m(f + C / 2, S);
26
+ },
27
+ children: [
28
+ /* @__PURE__ */ T(c, {
29
+ height: i - S,
30
+ width: C + 12,
31
+ x: f - 6,
32
+ y: S
33
+ }),
34
+ v > 0 ? /* @__PURE__ */ T("rect", {
35
+ className: "grow-y stroke-l5 shape-crisp",
36
+ fill: h(t),
37
+ height: Math.round(i) - w - 1,
38
+ strokeWidth: 1,
39
+ style: o(d * 2),
40
+ width: Math.round(e) - 1,
41
+ x: Math.round(f) + .5,
42
+ y: w + .5
43
+ }) : null,
44
+ /* @__PURE__ */ T(x, {
45
+ accent: u ? "fill-hero" : "fill-l2",
46
+ className: u ? "fill-hero" : "fill-l3",
47
+ floor: i,
48
+ id: `${n.label}-current`,
49
+ left: f + e + l,
50
+ n: y,
51
+ order: d * 2 + 1,
52
+ pitch: g,
53
+ width: e
54
+ }),
55
+ /* @__PURE__ */ T(p, {
56
+ anchor: "middle",
57
+ order: d,
58
+ voice: "axis",
59
+ x: f + e / 2,
60
+ y: b(i, v - 1, g) - 10,
61
+ children: a(n.previous)
62
+ }),
63
+ /* @__PURE__ */ T(p, {
64
+ anchor: "middle",
65
+ order: d,
66
+ voice: "value",
67
+ x: f + e + l + e / 2,
68
+ y: b(i, y - 1, g) - 10,
69
+ children: a(n.current)
70
+ }),
71
+ /* @__PURE__ */ T(p, {
72
+ anchor: "middle",
73
+ muted: !0,
74
+ voice: "label",
75
+ x: f + C / 2,
76
+ y: i + 18,
77
+ children: n.label
78
+ })
79
+ ]
80
+ });
81
+ }, O = (o) => {
82
+ let s = o.data ?? S, c = o.unit ?? 1, p = o.height ?? 440, b = o.format ?? String, [x, O] = o.periods ?? ["2011", "2021"], k = r(a(o)), A = e(), j = g("paired"), M = s.map((e) => `${e.label}: ${O} ${b(e.current)}, ${x} ${b(e.previous)}`).join("; ");
83
+ return /* @__PURE__ */ T(t, {
84
+ overlay: A.at === null ? null : /* @__PURE__ */ T(n, {
85
+ x: A.at.x,
86
+ y: A.at.y,
87
+ children: /* @__PURE__ */ T(l, {
88
+ facts: [`${O} ${b(s[A.at.key].current)}`, `${x} ${b(s[A.at.key].previous)}`],
89
+ lead: s[A.at.key].label
90
+ })
91
+ }),
92
+ children: (e) => {
93
+ let t = Math.min(e - 32, s.length * 130), n = (e - t) / 2, r = w().domain(s.map((e) => e.label)).range([n, n + t]).paddingInner(.34).paddingOuter(.2), l = r.bandwidth(), g = Math.max(4, Math.round(l * .1)), S = Math.max(...s.flatMap((e) => [e.current / c, e.previous / c])), N = i(a(o), e - 24), P = Math.round(p - (k ? 50 : 30) - Math.max(0, N.length - 1) * 12), F = y(P - 32, S), I = o.highlight ?? m(s.map((e) => e.current));
94
+ return /* @__PURE__ */ E(f, {
95
+ height: p,
96
+ label: M,
97
+ leave: A.clear,
98
+ width: e,
99
+ children: [
100
+ /* @__PURE__ */ E("defs", { children: [/* @__PURE__ */ T(_, {
101
+ id: j("hatch"),
102
+ tone: "fill-l4"
103
+ }), /* @__PURE__ */ T(v, {
104
+ id: j("rules"),
105
+ tone: "fill-l3"
106
+ })] }),
107
+ /* @__PURE__ */ T(C, {
108
+ align: "end",
109
+ items: [{
110
+ fill: h(j("hatch")),
111
+ name: x
112
+ }, {
113
+ fill: h(j("rules")),
114
+ name: O
115
+ }],
116
+ x: Math.round(n + t),
117
+ y: 16
118
+ }),
119
+ /* @__PURE__ */ T(d, {
120
+ x0: Math.round(n),
121
+ x1: Math.round(n + t),
122
+ y: P
123
+ }),
124
+ s.map((e, t) => /* @__PURE__ */ T(D, {
125
+ bw: (l - g) / 2,
126
+ hatch: j("hatch"),
127
+ datum: e,
128
+ dim: A.dim(t),
129
+ floor: P,
130
+ format: b,
131
+ gap: g,
132
+ hero: I === t,
133
+ index: t,
134
+ left: r(e.label) ?? 0,
135
+ onEnter: A.showAt(t),
136
+ pitch: F,
137
+ unit: c
138
+ }, e.label)),
139
+ /* @__PURE__ */ T(u, {
140
+ gutter: 12,
141
+ height: p,
142
+ text: a(o),
143
+ width: e
144
+ })
145
+ ]
146
+ });
147
+ }
148
+ });
149
+ };
150
+ //#endregion
151
+ export { O as PairedRungs };