@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.
- package/LICENSE +21 -0
- package/README.md +148 -2
- package/lib/charts/axes.js +5 -0
- package/lib/charts/basics/candlestick.data.js +44 -0
- package/lib/charts/basics/candlestick.js +180 -0
- package/lib/charts/basics/daily-empty.js +24 -0
- package/lib/charts/basics/daily-readings.js +16 -0
- package/lib/charts/basics/dot-heat.data.js +225 -0
- package/lib/charts/basics/dot-heat.js +174 -0
- package/lib/charts/basics/dumbbell-queue.js +203 -0
- package/lib/charts/basics/hairline-area.js +208 -0
- package/lib/charts/basics/hairline-line.js +195 -0
- package/lib/charts/basics/nested-treemap.data.js +55 -0
- package/lib/charts/basics/nested-treemap.js +191 -0
- package/lib/charts/basics/paired-rungs.data.js +31 -0
- package/lib/charts/basics/paired-rungs.js +151 -0
- package/lib/charts/basics/plumb-scatter.js +229 -0
- package/lib/charts/basics/rung-bars.js +178 -0
- package/lib/charts/basics/rung-geometry.js +6 -0
- package/lib/charts/basics/rung-histogram.data.js +73 -0
- package/lib/charts/basics/rung-histogram.js +153 -0
- package/lib/charts/basics/rung-waterfall.data.js +30 -0
- package/lib/charts/basics/rung-waterfall.js +150 -0
- package/lib/charts/basics/rungs.js +22 -0
- package/lib/charts/basics/series-key.js +26 -0
- package/lib/charts/basics/stacked-rungs.data.js +42 -0
- package/lib/charts/basics/stacked-rungs.js +174 -0
- package/lib/charts/basics/stream-ribbon.data.js +124 -0
- package/lib/charts/basics/stream-ribbon.js +336 -0
- package/lib/charts/basics/tick-box.data.js +50 -0
- package/lib/charts/basics/tick-box.js +226 -0
- package/lib/charts/basics/tick-donut.data.js +30 -0
- package/lib/charts/basics/tick-donut.js +210 -0
- package/lib/charts/basics/tick-gauge.data.js +8 -0
- package/lib/charts/basics/tick-gauge.js +169 -0
- package/lib/charts/basics/tick-rows.data.js +30 -0
- package/lib/charts/basics/tick-rows.js +121 -0
- package/lib/charts/basics/util-a.js +15 -0
- package/lib/charts/basics/util-b.js +13 -0
- package/lib/charts/big/circular-graph.data.js +827 -0
- package/lib/charts/big/circular-graph.js +289 -0
- package/lib/charts/big/force-galaxy-model.js +167 -0
- package/lib/charts/big/force-galaxy.data.js +813 -0
- package/lib/charts/big/force-galaxy.js +276 -0
- package/lib/charts/big/thread-triptych.data.js +204 -0
- package/lib/charts/big/thread-triptych.js +334 -0
- package/lib/charts/board/room.js +6 -0
- package/lib/charts/board/slope.js +176 -0
- package/lib/charts/board/spread.js +28 -0
- package/lib/charts/control.js +18 -0
- package/lib/charts/core.js +84 -0
- package/lib/charts/data-table.js +34 -0
- package/lib/charts/fills.js +153 -0
- package/lib/charts/forms/area-difference.data.js +62 -0
- package/lib/charts/forms/area-difference.js +192 -0
- package/lib/charts/forms/brush-math.js +42 -0
- package/lib/charts/forms/brush-strip.js +199 -0
- package/lib/charts/forms/brushed-overview.data.js +374 -0
- package/lib/charts/forms/brushed-overview.js +162 -0
- package/lib/charts/forms/chord-ring.data.js +140 -0
- package/lib/charts/forms/chord-ring.js +167 -0
- package/lib/charts/forms/circle-pack.data.js +80 -0
- package/lib/charts/forms/circle-pack.js +99 -0
- package/lib/charts/forms/hatched-stack.data.js +71 -0
- package/lib/charts/forms/hatched-stack.js +228 -0
- package/lib/charts/forms/radial-year.data.js +13 -0
- package/lib/charts/forms/radial-year.js +156 -0
- package/lib/charts/frame.js +73 -0
- package/lib/charts/glance/aggregate-sankey.data.js +74 -0
- package/lib/charts/glance/aggregate-sankey.js +242 -0
- package/lib/charts/glance/bar-race.data.js +122 -0
- package/lib/charts/glance/bar-race.js +246 -0
- package/lib/charts/glance/big-slice.data.js +41 -0
- package/lib/charts/glance/big-slice.js +238 -0
- package/lib/charts/glance/chunky-bars.data.js +22 -0
- package/lib/charts/glance/chunky-bars.js +113 -0
- package/lib/charts/glance/circular-graph.data.js +146 -0
- package/lib/charts/glance/circular-graph.js +138 -0
- package/lib/charts/glance/control-slot.js +9 -0
- package/lib/charts/glance/diverging-bar.data.js +34 -0
- package/lib/charts/glance/diverging-bar.js +154 -0
- package/lib/charts/glance/dot-waffle.data.js +26 -0
- package/lib/charts/glance/dot-waffle.js +179 -0
- package/lib/charts/glance/draw-in.data.js +9 -0
- package/lib/charts/glance/draw-in.goals.json.js +289 -0
- package/lib/charts/glance/draw-in.js +214 -0
- package/lib/charts/glance/dynamic-stream.data.js +6 -0
- package/lib/charts/glance/dynamic-stream.js +189 -0
- package/lib/charts/glance/force-graph.data.js +77 -0
- package/lib/charts/glance/force-graph.js +211 -0
- package/lib/charts/glance/jitter-strip.data.js +10 -0
- package/lib/charts/glance/jitter-strip.easter.json.js +430 -0
- package/lib/charts/glance/jitter-strip.js +157 -0
- package/lib/charts/glance/link-bundle.js +51 -0
- package/lib/charts/glance/matrix-heat-glance.data.js +108 -0
- package/lib/charts/glance/matrix-heat-glance.js +170 -0
- package/lib/charts/glance/pictorial-bar.data.js +22 -0
- package/lib/charts/glance/pictorial-bar.js +180 -0
- package/lib/charts/glance/rainfall-dual-area.data.js +177 -0
- package/lib/charts/glance/rainfall-dual-area.js +192 -0
- package/lib/charts/glance/rank-strip.data.js +76 -0
- package/lib/charts/glance/rank-strip.js +172 -0
- package/lib/charts/glance/scatter-labels.js +60 -0
- package/lib/charts/glance/scatter-morph.data.js +78 -0
- package/lib/charts/glance/scatter-morph.js +338 -0
- package/lib/charts/glance/single-axis.data.js +6 -0
- package/lib/charts/glance/single-axis.js +150 -0
- package/lib/charts/glance/single-axis.tides.json.js +180 -0
- package/lib/charts/glance/stagger-wave.data.js +66 -0
- package/lib/charts/glance/stagger-wave.js +132 -0
- package/lib/charts/glance/tree-lr.data.js +41 -0
- package/lib/charts/glance/tree-lr.js +135 -0
- package/lib/charts/glance/util-a.js +49 -0
- package/lib/charts/glance/util-b.js +19 -0
- package/lib/charts/glance/violin.data.js +9 -0
- package/lib/charts/glance/violin.js +185 -0
- package/lib/charts/glance/violin.tenors.json.js +5 -0
- package/lib/charts/hooks.js +154 -0
- package/lib/charts/hover.js +19 -0
- package/lib/charts/lupi/arc-matrix.data.js +83 -0
- package/lib/charts/lupi/arc-matrix.js +146 -0
- package/lib/charts/lupi/ballot-tally.data.js +22 -0
- package/lib/charts/lupi/ballot-tally.js +125 -0
- package/lib/charts/lupi/barcode-lollipop.data.js +195 -0
- package/lib/charts/lupi/barcode-lollipop.js +161 -0
- package/lib/charts/lupi/brand-spectrum.data.js +70 -0
- package/lib/charts/lupi/brand-spectrum.js +233 -0
- package/lib/charts/lupi/bubble-almanac.data.js +689 -0
- package/lib/charts/lupi/bubble-almanac.js +164 -0
- package/lib/charts/lupi/calendar-heat.data.js +399 -0
- package/lib/charts/lupi/calendar-heat.js +175 -0
- package/lib/charts/lupi/cluster-field.data.js +83 -0
- package/lib/charts/lupi/cluster-field.js +173 -0
- package/lib/charts/lupi/dot-cascade.data.js +54 -0
- package/lib/charts/lupi/dot-cascade.js +124 -0
- package/lib/charts/lupi/dotty-matrix.data.js +170 -0
- package/lib/charts/lupi/dotty-matrix.js +126 -0
- package/lib/charts/lupi/hourglass-stream.data.js +30 -0
- package/lib/charts/lupi/hourglass-stream.js +158 -0
- package/lib/charts/lupi/hundred-field.data.js +38 -0
- package/lib/charts/lupi/hundred-field.js +237 -0
- package/lib/charts/lupi/launch-fan.data.js +315 -0
- package/lib/charts/lupi/launch-fan.js +198 -0
- package/lib/charts/lupi/matrix-heat.data.js +97 -0
- package/lib/charts/lupi/matrix-heat.js +246 -0
- package/lib/charts/lupi/parallel-coordinates.data.js +54 -0
- package/lib/charts/lupi/parallel-coordinates.js +218 -0
- package/lib/charts/lupi/radial-convergence.data.js +178 -0
- package/lib/charts/lupi/radial-convergence.js +208 -0
- package/lib/charts/lupi/radial-patchwork.data.js +454 -0
- package/lib/charts/lupi/radial-patchwork.js +181 -0
- package/lib/charts/lupi/ridgeline.data.js +1834 -0
- package/lib/charts/lupi/ridgeline.js +195 -0
- package/lib/charts/lupi/trend-lineage.data.js +51 -0
- package/lib/charts/lupi/trend-lineage.js +198 -0
- package/lib/charts/lupi/type-colonnade.data.js +18 -0
- package/lib/charts/lupi/type-colonnade.js +198 -0
- package/lib/charts/lupi/util-a.js +14 -0
- package/lib/charts/lupi/util-b.js +12 -0
- package/lib/charts/maps/choropleth.js +295 -0
- package/lib/charts/maps/geo.js +84 -0
- package/lib/charts/maps/legend.js +83 -0
- package/lib/charts/maps/step-fill.js +9 -0
- package/lib/charts/maps/us-choropleth.data.js +249 -0
- package/lib/charts/maps/us-choropleth.js +41 -0
- package/lib/charts/maps/world-choropleth.data.js +681 -0
- package/lib/charts/maps/world-choropleth.js +46 -0
- package/lib/charts/markers.js +35 -0
- package/lib/charts/marks.js +31 -0
- package/lib/charts/motion.js +11 -0
- package/lib/charts/originals/daily-users.data.js +101 -0
- package/lib/charts/originals/daily-users.js +203 -0
- package/lib/charts/originals/feature-rank.data.js +92 -0
- package/lib/charts/originals/feature-rank.js +167 -0
- package/lib/charts/originals/format.js +5 -0
- package/lib/charts/originals/key.js +26 -0
- package/lib/charts/originals/response-time.data.js +98 -0
- package/lib/charts/originals/response-time.js +187 -0
- package/lib/charts/originals/revenue-by-plan.data.js +26 -0
- package/lib/charts/originals/revenue-by-plan.js +248 -0
- package/lib/charts/playback.js +68 -0
- package/lib/charts/plot-note.js +27 -0
- package/lib/charts/roles.js +5 -0
- package/lib/charts/rules.js +66 -0
- package/lib/charts/scale-context.js +6 -0
- package/lib/charts/shapes.js +8 -0
- package/lib/charts/shared-options.js +25 -0
- package/lib/charts/svg.js +43 -0
- package/lib/charts/text.js +30 -0
- package/lib/charts/texture-ids.js +20 -0
- package/lib/charts/texture.js +286 -0
- package/lib/charts/util.js +43 -0
- package/lib/charts/value-grid.js +26 -0
- package/lib/draw.js +27 -0
- package/lib/entries/dumbbell-queue.js +2 -0
- package/lib/entries/hairline-area.js +2 -0
- package/lib/entries/hairline-line.js +2 -0
- package/lib/entries/plumb-scatter.js +2 -0
- package/lib/entries/rung-bars.js +2 -0
- package/lib/entries/slope.js +2 -0
- package/lib/frame.js +2 -0
- package/lib/hairline.css +1385 -0
- package/lib/index.js +72 -0
- package/lib/json-schema/dumbbell-queue.json +258 -0
- package/lib/json-schema/hairline-area.json +262 -0
- package/lib/json-schema/hairline-line.json +256 -0
- package/lib/json-schema/index.json +50 -0
- package/lib/json-schema/plumb-scatter.json +363 -0
- package/lib/json-schema/rung-bars.json +230 -0
- package/lib/json-schema/slope.json +333 -0
- package/lib/kit.js +16 -0
- package/lib/lib/format.js +29 -0
- package/lib/lib/random.js +8 -0
- package/lib/maps.js +4 -0
- package/lib/schema/daily.js +9 -0
- package/lib/schema/dumbbell-queue.js +28 -0
- package/lib/schema/format.js +72 -0
- package/lib/schema/hairline-area.js +24 -0
- package/lib/schema/hairline-line.js +23 -0
- package/lib/schema/key.js +4 -0
- package/lib/schema/metrics.js +26 -0
- package/lib/schema/motion.js +12 -0
- package/lib/schema/options.js +21 -0
- package/lib/schema/plumb-scatter.js +48 -0
- package/lib/schema/registry.js +132 -0
- package/lib/schema/rung-bars.js +25 -0
- package/lib/schema/scale.js +9 -0
- package/lib/schema/slope.js +28 -0
- package/lib/schema/validate.js +25 -0
- package/lib/schema.js +16 -0
- package/lib/theme/derive.js +98 -0
- package/lib/theme.css +443 -0
- package/lib/theme.js +1 -0
- package/lib/tokens.css +306 -0
- package/lib/types/charts/axes.d.ts +14 -0
- package/lib/types/charts/basics/candlestick.d.ts +22 -0
- package/lib/types/charts/basics/candlestick.data.d.ts +10 -0
- package/lib/types/charts/basics/daily-empty.d.ts +7 -0
- package/lib/types/charts/basics/daily-readings.d.ts +38 -0
- package/lib/types/charts/basics/dot-heat.d.ts +19 -0
- package/lib/types/charts/basics/dot-heat.data.d.ts +28 -0
- package/lib/types/charts/basics/dumbbell-queue.d.ts +15 -0
- package/lib/types/charts/basics/hairline-area.d.ts +18 -0
- package/lib/types/charts/basics/hairline-line.d.ts +18 -0
- package/lib/types/charts/basics/nested-treemap.d.ts +18 -0
- package/lib/types/charts/basics/nested-treemap.data.d.ts +30 -0
- package/lib/types/charts/basics/paired-rungs.d.ts +21 -0
- package/lib/types/charts/basics/paired-rungs.data.d.ts +43 -0
- package/lib/types/charts/basics/plumb-scatter.d.ts +14 -0
- package/lib/types/charts/basics/rung-bars.d.ts +16 -0
- package/lib/types/charts/basics/rung-geometry.d.ts +6 -0
- package/lib/types/charts/basics/rung-histogram.d.ts +22 -0
- package/lib/types/charts/basics/rung-histogram.data.d.ts +34 -0
- package/lib/types/charts/basics/rung-waterfall.d.ts +19 -0
- package/lib/types/charts/basics/rung-waterfall.data.d.ts +31 -0
- package/lib/types/charts/basics/rungs.d.ts +28 -0
- package/lib/types/charts/basics/series-key.d.ts +19 -0
- package/lib/types/charts/basics/stacked-rungs.d.ts +20 -0
- package/lib/types/charts/basics/stacked-rungs.data.d.ts +26 -0
- package/lib/types/charts/basics/stream-ribbon.d.ts +19 -0
- package/lib/types/charts/basics/stream-ribbon.data.d.ts +29 -0
- package/lib/types/charts/basics/tick-box.d.ts +19 -0
- package/lib/types/charts/basics/tick-box.data.d.ts +30 -0
- package/lib/types/charts/basics/tick-donut.d.ts +24 -0
- package/lib/types/charts/basics/tick-donut.data.d.ts +25 -0
- package/lib/types/charts/basics/tick-gauge.d.ts +22 -0
- package/lib/types/charts/basics/tick-gauge.data.d.ts +24 -0
- package/lib/types/charts/basics/tick-rows.d.ts +18 -0
- package/lib/types/charts/basics/tick-rows.data.d.ts +23 -0
- package/lib/types/charts/basics/util-a.d.ts +10 -0
- package/lib/types/charts/basics/util-b.d.ts +13 -0
- package/lib/types/charts/big/circular-graph.d.ts +20 -0
- package/lib/types/charts/big/circular-graph.data.d.ts +46 -0
- package/lib/types/charts/big/force-galaxy-model.d.ts +109 -0
- package/lib/types/charts/big/force-galaxy.d.ts +18 -0
- package/lib/types/charts/big/force-galaxy.data.d.ts +48 -0
- package/lib/types/charts/big/thread-triptych.d.ts +17 -0
- package/lib/types/charts/big/thread-triptych.data.d.ts +41 -0
- package/lib/types/charts/board/room.d.ts +18 -0
- package/lib/types/charts/board/slope.d.ts +14 -0
- package/lib/types/charts/board/spread.d.ts +5 -0
- package/lib/types/charts/control.d.ts +17 -0
- package/lib/types/charts/core.d.ts +77 -0
- package/lib/types/charts/data-table.d.ts +18 -0
- package/lib/types/charts/fills.d.ts +103 -0
- package/lib/types/charts/forms/area-difference.d.ts +9 -0
- package/lib/types/charts/forms/area-difference.data.d.ts +26 -0
- package/lib/types/charts/forms/brush-math.d.ts +19 -0
- package/lib/types/charts/forms/brush-strip.d.ts +19 -0
- package/lib/types/charts/forms/brushed-overview.d.ts +12 -0
- package/lib/types/charts/forms/brushed-overview.data.d.ts +16 -0
- package/lib/types/charts/forms/chord-ring.d.ts +12 -0
- package/lib/types/charts/forms/chord-ring.data.d.ts +29 -0
- package/lib/types/charts/forms/circle-pack.d.ts +9 -0
- package/lib/types/charts/forms/circle-pack.data.d.ts +23 -0
- package/lib/types/charts/forms/hatched-stack.d.ts +10 -0
- package/lib/types/charts/forms/hatched-stack.data.d.ts +36 -0
- package/lib/types/charts/forms/radial-year.d.ts +8 -0
- package/lib/types/charts/forms/radial-year.data.d.ts +17 -0
- package/lib/types/charts/frame.d.ts +21 -0
- package/lib/types/charts/glance/aggregate-sankey.d.ts +23 -0
- package/lib/types/charts/glance/aggregate-sankey.data.d.ts +32 -0
- package/lib/types/charts/glance/bar-race.d.ts +20 -0
- package/lib/types/charts/glance/bar-race.data.d.ts +32 -0
- package/lib/types/charts/glance/big-slice.d.ts +27 -0
- package/lib/types/charts/glance/big-slice.data.d.ts +30 -0
- package/lib/types/charts/glance/chunky-bars.d.ts +18 -0
- package/lib/types/charts/glance/chunky-bars.data.d.ts +24 -0
- package/lib/types/charts/glance/circular-graph.d.ts +19 -0
- package/lib/types/charts/glance/circular-graph.data.d.ts +43 -0
- package/lib/types/charts/glance/control-slot.d.ts +9 -0
- package/lib/types/charts/glance/diverging-bar.d.ts +19 -0
- package/lib/types/charts/glance/diverging-bar.data.d.ts +27 -0
- package/lib/types/charts/glance/dot-waffle.d.ts +19 -0
- package/lib/types/charts/glance/dot-waffle.data.d.ts +31 -0
- package/lib/types/charts/glance/draw-in.d.ts +20 -0
- package/lib/types/charts/glance/draw-in.data.d.ts +6 -0
- package/lib/types/charts/glance/dynamic-stream.d.ts +22 -0
- package/lib/types/charts/glance/dynamic-stream.data.d.ts +7 -0
- package/lib/types/charts/glance/force-graph.d.ts +16 -0
- package/lib/types/charts/glance/force-graph.data.d.ts +45 -0
- package/lib/types/charts/glance/jitter-strip.d.ts +24 -0
- package/lib/types/charts/glance/jitter-strip.data.d.ts +27 -0
- package/lib/types/charts/glance/link-bundle.d.ts +22 -0
- package/lib/types/charts/glance/matrix-heat-glance.d.ts +22 -0
- package/lib/types/charts/glance/matrix-heat-glance.data.d.ts +35 -0
- package/lib/types/charts/glance/pictorial-bar.d.ts +20 -0
- package/lib/types/charts/glance/pictorial-bar.data.d.ts +27 -0
- package/lib/types/charts/glance/rainfall-dual-area.d.ts +19 -0
- package/lib/types/charts/glance/rainfall-dual-area.data.d.ts +32 -0
- package/lib/types/charts/glance/rank-strip.d.ts +19 -0
- package/lib/types/charts/glance/rank-strip.data.d.ts +36 -0
- package/lib/types/charts/glance/scatter-labels.d.ts +23 -0
- package/lib/types/charts/glance/scatter-morph.d.ts +22 -0
- package/lib/types/charts/glance/scatter-morph.data.d.ts +30 -0
- package/lib/types/charts/glance/single-axis.d.ts +27 -0
- package/lib/types/charts/glance/single-axis.data.d.ts +6 -0
- package/lib/types/charts/glance/stagger-wave.d.ts +18 -0
- package/lib/types/charts/glance/stagger-wave.data.d.ts +26 -0
- package/lib/types/charts/glance/tree-lr.d.ts +16 -0
- package/lib/types/charts/glance/tree-lr.data.d.ts +27 -0
- package/lib/types/charts/glance/util-a.d.ts +31 -0
- package/lib/types/charts/glance/util-b.d.ts +12 -0
- package/lib/types/charts/glance/violin.d.ts +22 -0
- package/lib/types/charts/glance/violin.data.d.ts +24 -0
- package/lib/types/charts/hooks.d.ts +109 -0
- package/lib/types/charts/hover.d.ts +26 -0
- package/lib/types/charts/lupi/arc-matrix.d.ts +18 -0
- package/lib/types/charts/lupi/arc-matrix.data.d.ts +28 -0
- package/lib/types/charts/lupi/ballot-tally.d.ts +19 -0
- package/lib/types/charts/lupi/ballot-tally.data.d.ts +28 -0
- package/lib/types/charts/lupi/barcode-lollipop.d.ts +19 -0
- package/lib/types/charts/lupi/barcode-lollipop.data.d.ts +26 -0
- package/lib/types/charts/lupi/brand-spectrum.d.ts +28 -0
- package/lib/types/charts/lupi/brand-spectrum.data.d.ts +34 -0
- package/lib/types/charts/lupi/bubble-almanac.d.ts +22 -0
- package/lib/types/charts/lupi/bubble-almanac.data.d.ts +45 -0
- package/lib/types/charts/lupi/calendar-heat.d.ts +19 -0
- package/lib/types/charts/lupi/calendar-heat.data.d.ts +20 -0
- package/lib/types/charts/lupi/cluster-field.d.ts +21 -0
- package/lib/types/charts/lupi/cluster-field.data.d.ts +52 -0
- package/lib/types/charts/lupi/dot-cascade.d.ts +22 -0
- package/lib/types/charts/lupi/dot-cascade.data.d.ts +24 -0
- package/lib/types/charts/lupi/dotty-matrix.d.ts +17 -0
- package/lib/types/charts/lupi/dotty-matrix.data.d.ts +32 -0
- package/lib/types/charts/lupi/hourglass-stream.d.ts +18 -0
- package/lib/types/charts/lupi/hourglass-stream.data.d.ts +27 -0
- package/lib/types/charts/lupi/hundred-field.d.ts +18 -0
- package/lib/types/charts/lupi/hundred-field.data.d.ts +24 -0
- package/lib/types/charts/lupi/launch-fan.d.ts +37 -0
- package/lib/types/charts/lupi/launch-fan.data.d.ts +41 -0
- package/lib/types/charts/lupi/matrix-heat.d.ts +20 -0
- package/lib/types/charts/lupi/matrix-heat.data.d.ts +29 -0
- package/lib/types/charts/lupi/parallel-coordinates.d.ts +23 -0
- package/lib/types/charts/lupi/parallel-coordinates.data.d.ts +40 -0
- package/lib/types/charts/lupi/radial-convergence.d.ts +15 -0
- package/lib/types/charts/lupi/radial-convergence.data.d.ts +24 -0
- package/lib/types/charts/lupi/radial-patchwork.d.ts +16 -0
- package/lib/types/charts/lupi/radial-patchwork.data.d.ts +35 -0
- package/lib/types/charts/lupi/ridgeline.d.ts +23 -0
- package/lib/types/charts/lupi/ridgeline.data.d.ts +19 -0
- package/lib/types/charts/lupi/trend-lineage.d.ts +18 -0
- package/lib/types/charts/lupi/trend-lineage.data.d.ts +56 -0
- package/lib/types/charts/lupi/type-colonnade.d.ts +20 -0
- package/lib/types/charts/lupi/type-colonnade.data.d.ts +30 -0
- package/lib/types/charts/lupi/util-a.d.ts +9 -0
- package/lib/types/charts/lupi/util-b.d.ts +11 -0
- package/lib/types/charts/maps/choropleth.d.ts +33 -0
- package/lib/types/charts/maps/geo.d.ts +48 -0
- package/lib/types/charts/maps/legend.d.ts +14 -0
- package/lib/types/charts/maps/step-fill.d.ts +6 -0
- package/lib/types/charts/maps/us-choropleth.d.ts +25 -0
- package/lib/types/charts/maps/us-choropleth.data.d.ts +23 -0
- package/lib/types/charts/maps/world-choropleth.d.ts +22 -0
- package/lib/types/charts/maps/world-choropleth.data.d.ts +35 -0
- package/lib/types/charts/markers.d.ts +42 -0
- package/lib/types/charts/marks.d.ts +58 -0
- package/lib/types/charts/motion.d.ts +12 -0
- package/lib/types/charts/originals/daily-users.d.ts +13 -0
- package/lib/types/charts/originals/daily-users.data.d.ts +17 -0
- package/lib/types/charts/originals/feature-rank.d.ts +13 -0
- package/lib/types/charts/originals/feature-rank.data.d.ts +29 -0
- package/lib/types/charts/originals/format.d.ts +2 -0
- package/lib/types/charts/originals/key.d.ts +16 -0
- package/lib/types/charts/originals/response-time.d.ts +11 -0
- package/lib/types/charts/originals/response-time.data.d.ts +24 -0
- package/lib/types/charts/originals/revenue-by-plan.d.ts +12 -0
- package/lib/types/charts/originals/revenue-by-plan.data.d.ts +26 -0
- package/lib/types/charts/playback.d.ts +42 -0
- package/lib/types/charts/plot-note.d.ts +37 -0
- package/lib/types/charts/roles.d.ts +28 -0
- package/lib/types/charts/rules.d.ts +62 -0
- package/lib/types/charts/scale-context.d.ts +3 -0
- package/lib/types/charts/shapes.d.ts +9 -0
- package/lib/types/charts/shared-options.d.ts +25 -0
- package/lib/types/charts/svg.d.ts +24 -0
- package/lib/types/charts/text.d.ts +36 -0
- package/lib/types/charts/texture-ids.d.ts +24 -0
- package/lib/types/charts/texture.d.ts +185 -0
- package/lib/types/charts/util.d.ts +66 -0
- package/lib/types/charts/value-grid.d.ts +22 -0
- package/lib/types/draw.d.ts +279 -0
- package/lib/types/entries/dumbbell-queue.d.ts +2 -0
- package/lib/types/entries/hairline-area.d.ts +2 -0
- package/lib/types/entries/hairline-line.d.ts +2 -0
- package/lib/types/entries/plumb-scatter.d.ts +2 -0
- package/lib/types/entries/rung-bars.d.ts +2 -0
- package/lib/types/entries/slope.d.ts +2 -0
- package/lib/types/frame.d.ts +2 -0
- package/lib/types/index.d.ts +82 -0
- package/lib/types/kit.d.ts +22 -0
- package/lib/types/lib/format.d.ts +58 -0
- package/lib/types/lib/random.d.ts +5 -0
- package/lib/types/maps.d.ts +2 -0
- package/lib/types/schema/daily.d.ts +14 -0
- package/lib/types/schema/dumbbell-queue.d.ts +91 -0
- package/lib/types/schema/format.d.ts +101 -0
- package/lib/types/schema/hairline-area.d.ts +83 -0
- package/lib/types/schema/hairline-line.d.ts +85 -0
- package/lib/types/schema/key.d.ts +12 -0
- package/lib/types/schema/metrics.d.ts +26 -0
- package/lib/types/schema/motion.d.ts +22 -0
- package/lib/types/schema/options.d.ts +51 -0
- package/lib/types/schema/plumb-scatter.d.ts +124 -0
- package/lib/types/schema/registry.d.ts +309 -0
- package/lib/types/schema/rung-bars.d.ts +84 -0
- package/lib/types/schema/scale.d.ts +34 -0
- package/lib/types/schema/slope.d.ts +120 -0
- package/lib/types/schema/validate.d.ts +29 -0
- package/lib/types/schema.d.ts +30 -0
- package/lib/types/theme/derive.d.ts +23 -0
- package/lib/types/theme.d.ts +2 -0
- package/lib/vendor/us-atlas/states-10m.json.js +13855 -0
- package/lib/vendor/world-atlas/countries-110m.json.js +9357 -0
- package/package.json +162 -4
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { monthTickLabels as e } from "../../lib/format.js";
|
|
3
|
+
import { useHover as t } from "../hooks.js";
|
|
4
|
+
import { Plot as n, Tooltip as r } from "../core.js";
|
|
5
|
+
import { noteOf as i, noteSpace as a, stagger as o } from "../util.js";
|
|
6
|
+
import { DimGroup as s, TipText as c } from "../hover.js";
|
|
7
|
+
import { FootNote as l } from "../plot-note.js";
|
|
8
|
+
import { ChartSvg as u } from "../svg.js";
|
|
9
|
+
import { Label as d } from "../text.js";
|
|
10
|
+
import { HALFTONE_R as f, TEXTURE_PITCH as p, paint as m, useTextureIds as h } from "../texture-ids.js";
|
|
11
|
+
import { CrossHatch as g, DotScreen as _ } from "../texture.js";
|
|
12
|
+
import { calendarHeatDemo as v } from "./calendar-heat.data.js";
|
|
13
|
+
import { utcFormat as y } from "d3-time-format";
|
|
14
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
15
|
+
//#region src/charts/lupi/calendar-heat.tsx
|
|
16
|
+
var S = 864e5, C = 3, w = 6, T = 4, E = f, D = 2.5, O = Math.floor(p.screen / 2) + .5, k = y("%a %-d %b %Y"), A = (e, t) => {
|
|
17
|
+
let n = new Date(Date.parse(`${e[0]?.date ?? "1970-01-01"}T00:00:00Z`)), r = (n.getUTCDay() + 6) % 7, i = e.map((e) => {
|
|
18
|
+
let i = Date.parse(`${e.date}T00:00:00Z`), a = new Date(i), o = (a.getUTCFullYear() - n.getUTCFullYear()) * 12 + a.getUTCMonth() - n.getUTCMonth();
|
|
19
|
+
return {
|
|
20
|
+
...e,
|
|
21
|
+
band: Math.floor(o / t),
|
|
22
|
+
col: Math.floor((Math.round((i - n.getTime()) / S) + r) / 7),
|
|
23
|
+
dow: (a.getUTCDay() + 6) % 7,
|
|
24
|
+
month: o,
|
|
25
|
+
t: i
|
|
26
|
+
};
|
|
27
|
+
}), a = /* @__PURE__ */ new Map();
|
|
28
|
+
for (let e of i) a.set(e.band, Math.min(a.get(e.band) ?? e.col, e.col));
|
|
29
|
+
return i.map((e) => ({
|
|
30
|
+
...e,
|
|
31
|
+
col: e.col - (a.get(e.band) ?? 0)
|
|
32
|
+
}));
|
|
33
|
+
}, j = (e, t, n) => `${e}:${t}:${n}`, M = (e, t) => e.x0 + e.pitch * t.col, N = (e, t) => e.top + t.band * e.bandH + e.pitch * t.dow, P = (e, t) => e.x0 + e.pitch * t - 2, F = (e, t, n) => e.top + t * e.bandH + e.pitch * n - 2, I = (e, t) => t <= 0 ? -1 : t >= e.max ? E.length : Math.min(E.length - 1, Math.floor(t / e.max * E.length)), L = (e, t) => `${e ? "end" : "week"}-${t}`, R = ({ ids: e }) => /* @__PURE__ */ x("defs", { children: [[!1, !0].flatMap((t) => E.map((n, r) => /* @__PURE__ */ b(_, {
|
|
34
|
+
id: e(L(t, r)),
|
|
35
|
+
r: n,
|
|
36
|
+
tone: t ? "fill-l4" : "fill-l3"
|
|
37
|
+
}, L(t, r)))), /* @__PURE__ */ b(g, {
|
|
38
|
+
id: e("peak"),
|
|
39
|
+
tone: "fill-hero"
|
|
40
|
+
})] }), z = (e, t, n) => {
|
|
41
|
+
let r = I(e, t.value);
|
|
42
|
+
return r < 0 ? null : r >= E.length ? {
|
|
43
|
+
fill: m(n("peak")),
|
|
44
|
+
rule: "stroke-ink"
|
|
45
|
+
} : {
|
|
46
|
+
fill: m(n(L(t.dow >= 5, r))),
|
|
47
|
+
rule: ""
|
|
48
|
+
};
|
|
49
|
+
}, B = (e) => {
|
|
50
|
+
let { d: t, g: n } = e, r = z(n, t, e.ids);
|
|
51
|
+
return r === null ? null : /* @__PURE__ */ b("g", {
|
|
52
|
+
transform: `translate(${M(n, t) - n.inset} ${N(n, t) - n.inset})`,
|
|
53
|
+
children: /* @__PURE__ */ b("rect", {
|
|
54
|
+
className: `pop shape-crisp ${r.rule}`,
|
|
55
|
+
fill: r.fill,
|
|
56
|
+
height: n.cell - 1,
|
|
57
|
+
strokeWidth: 1,
|
|
58
|
+
style: o(t.col + t.band * 4 + t.dow * .3, "fine"),
|
|
59
|
+
width: n.cell - 1,
|
|
60
|
+
x: n.inset + .5,
|
|
61
|
+
y: n.inset + .5
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}, V = (e, t, n, r) => `M${e} ${t}h${n}v${r}h${-n}z`, H = (e, t) => {
|
|
65
|
+
let n = new Map(e.map((e) => [j(e.band, e.col, e.dow), e])), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = (e, t, n) => {
|
|
66
|
+
r.has(t) || (r.add(t), i.set(e.month, [...i.get(e.month) ?? [], n]));
|
|
67
|
+
};
|
|
68
|
+
for (let r of e) {
|
|
69
|
+
let e = (e, t) => n.get(j(r.band, e, t))?.month !== r.month, i = (e) => P(t, e), o = (e) => F(t, r.band, e);
|
|
70
|
+
for (let n of [r.col, r.col + 1]) e(n === r.col ? n - 1 : n, r.dow) && a(r, `v${r.band}:${n}:${r.dow}`, V(i(n), o(r.dow), 1, t.pitch + 1));
|
|
71
|
+
for (let n of [r.dow, r.dow + 1]) e(r.col, n === r.dow ? n - 1 : n) && a(r, `h${r.band}:${r.col}:${n}`, V(i(r.col), o(n), t.pitch + 1, 1));
|
|
72
|
+
}
|
|
73
|
+
return [...i.entries()].map(([e, t]) => ({
|
|
74
|
+
d: t.join(""),
|
|
75
|
+
month: e
|
|
76
|
+
}));
|
|
77
|
+
}, U = ({ days: t, g: n }) => {
|
|
78
|
+
let r = t.filter((e) => e.dow === 0), i = r.filter((e, t) => r.findIndex((t) => t.month === e.month) === t), a = e(i.map((e) => new Date(e.t))), o = Math.max(...t.map((e) => e.band)) + 1;
|
|
79
|
+
return /* @__PURE__ */ x("g", { children: [i.map((e, t) => /* @__PURE__ */ b(d, {
|
|
80
|
+
order: e.col + e.band * 4,
|
|
81
|
+
tier: "fine",
|
|
82
|
+
voice: "axis",
|
|
83
|
+
x: P(n, i.findIndex((t) => t.band === e.band) === t ? 0 : e.col),
|
|
84
|
+
y: F(n, e.band, 0) - 9,
|
|
85
|
+
children: a[t]
|
|
86
|
+
}, e.date)), Array.from({ length: o }, (e, t) => t).flatMap((e) => [
|
|
87
|
+
"Mon",
|
|
88
|
+
"Wed",
|
|
89
|
+
"Fri",
|
|
90
|
+
"Sun"
|
|
91
|
+
].map((t, r) => /* @__PURE__ */ b(d, {
|
|
92
|
+
anchor: "end",
|
|
93
|
+
middle: !0,
|
|
94
|
+
voice: "axis",
|
|
95
|
+
x: n.x0 - (n.narrow ? 8 : 14),
|
|
96
|
+
y: F(n, e, r * 2) + 2 + n.cell / 2,
|
|
97
|
+
children: t
|
|
98
|
+
}, `${e}-${t}`)))] });
|
|
99
|
+
}, W = (e, t, n) => {
|
|
100
|
+
let r = e.currentTarget.getBoundingClientRect(), i = e.clientY - r.top - t.top + 2, a = Math.floor(i / t.bandH), o = Math.floor((e.clientX - r.left - t.x0 + 2) / t.pitch), s = Math.floor((i - a * t.bandH) / t.pitch);
|
|
101
|
+
return n.get(j(a, o, s)) ?? null;
|
|
102
|
+
}, G = (e, t, n) => `Daily ${t} across ${e.length} days${n === void 0 ? "" : `; busiest ${k(new Date(n.t))} with ${n.value}`}`, K = (e, t, n, r, i) => {
|
|
103
|
+
let a = e < 640, o = a ? 36 : 46, s = Math.max(...t.map((e) => e.band)) + 1, c = Math.max(...t.map((e) => e.col)) + 1, l = e - o - 8, u = ((i ?? (a ? Infinity : 560)) - 26 - r - (s - 1) * 42) / (7 * s), d = 2 * Math.floor(Math.min(44, l / c, u) / 2), f = d - C, m = Math.floor((f - 2 * D) / p.screen) + 1, h = (f - p.screen * (m - 1)) / 2;
|
|
104
|
+
return {
|
|
105
|
+
bandH: d * 7 + 42,
|
|
106
|
+
cell: f,
|
|
107
|
+
inset: O - h,
|
|
108
|
+
max: n,
|
|
109
|
+
narrow: a,
|
|
110
|
+
pitch: d,
|
|
111
|
+
svgH: 26 + s * (d * 7 + 42) - 42 + r,
|
|
112
|
+
top: 26,
|
|
113
|
+
x0: o + Math.max(0, Math.floor((l - d * c) / 2))
|
|
114
|
+
};
|
|
115
|
+
}, q = (e) => {
|
|
116
|
+
let d = e.data ?? v, f = e.unit ?? "events", p = t(), m = h("almanac"), g = Math.max(1, ...d.map((e) => e.value));
|
|
117
|
+
return /* @__PURE__ */ b(n, { children: (t) => {
|
|
118
|
+
let n = A(d, t < 640 ? T : w), h = n.find((e) => e.value === g), _ = 6 + a(i(e), t - 16, 24), v = K(t, n, g, _, e.height), y = new Map(n.map((e, t) => [j(e.band, e.col, e.dow), t])), S = p.key === null ? void 0 : n[p.key];
|
|
119
|
+
return /* @__PURE__ */ x("div", {
|
|
120
|
+
className: "relative",
|
|
121
|
+
children: [/* @__PURE__ */ x(u, {
|
|
122
|
+
height: v.svgH,
|
|
123
|
+
label: G(n, f, h),
|
|
124
|
+
leave: p.clear,
|
|
125
|
+
onPointerMove: (e) => {
|
|
126
|
+
p.set(W(e, v, y));
|
|
127
|
+
},
|
|
128
|
+
title: `Daily ${f}`,
|
|
129
|
+
width: t,
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ b(R, { ids: m }),
|
|
132
|
+
/* @__PURE__ */ b(U, {
|
|
133
|
+
days: n,
|
|
134
|
+
g: v
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ b(s, {
|
|
137
|
+
dim: p.key !== null,
|
|
138
|
+
children: n.map((e) => /* @__PURE__ */ b(B, {
|
|
139
|
+
d: e,
|
|
140
|
+
g: v,
|
|
141
|
+
ids: m
|
|
142
|
+
}, e.date))
|
|
143
|
+
}),
|
|
144
|
+
H(n, v).map((e) => /* @__PURE__ */ b("path", {
|
|
145
|
+
className: "fade fill-l2 shape-crisp",
|
|
146
|
+
d: e.d,
|
|
147
|
+
style: o(e.month, "mark")
|
|
148
|
+
}, e.month)),
|
|
149
|
+
S !== void 0 && /* @__PURE__ */ b("rect", {
|
|
150
|
+
className: "stroke-ink shape-crisp pointer-events-none fill-none",
|
|
151
|
+
height: v.cell - 1,
|
|
152
|
+
strokeWidth: 1,
|
|
153
|
+
width: v.cell - 1,
|
|
154
|
+
x: M(v, S) + .5,
|
|
155
|
+
y: N(v, S) + .5
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ b(l, {
|
|
158
|
+
height: v.svgH,
|
|
159
|
+
text: i(e),
|
|
160
|
+
width: t
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
}), S !== void 0 && /* @__PURE__ */ b(r, {
|
|
164
|
+
x: M(v, S) + v.cell / 2,
|
|
165
|
+
y: N(v, S) - 4,
|
|
166
|
+
children: /* @__PURE__ */ b(c, {
|
|
167
|
+
facts: [`${S.value} ${f}`],
|
|
168
|
+
lead: k(new Date(S.t))
|
|
169
|
+
})
|
|
170
|
+
})]
|
|
171
|
+
});
|
|
172
|
+
} });
|
|
173
|
+
};
|
|
174
|
+
//#endregion
|
|
175
|
+
export { q as CalendarHeat };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/charts/lupi/cluster-field.data.ts
|
|
3
|
+
var e = {
|
|
4
|
+
clusters: [
|
|
5
|
+
{
|
|
6
|
+
at: [215, 215],
|
|
7
|
+
id: "heunisch",
|
|
8
|
+
label: "Heunisch weiss",
|
|
9
|
+
members: [
|
|
10
|
+
222927,
|
|
11
|
+
53421,
|
|
12
|
+
30083,
|
|
13
|
+
24990,
|
|
14
|
+
23096,
|
|
15
|
+
18353,
|
|
16
|
+
15714,
|
|
17
|
+
12603,
|
|
18
|
+
12431,
|
|
19
|
+
8483
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
at: [500, 100],
|
|
24
|
+
id: "savagnin",
|
|
25
|
+
label: "Savagnin blanc",
|
|
26
|
+
members: [
|
|
27
|
+
144031,
|
|
28
|
+
131983,
|
|
29
|
+
30859,
|
|
30
|
+
25320,
|
|
31
|
+
19082,
|
|
32
|
+
11629,
|
|
33
|
+
8990
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
at: [545, 268],
|
|
38
|
+
id: "cabfranc",
|
|
39
|
+
label: "Cabernet franc",
|
|
40
|
+
members: [
|
|
41
|
+
279479,
|
|
42
|
+
257778,
|
|
43
|
+
10322
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
at: [450, 420],
|
|
48
|
+
id: "heben",
|
|
49
|
+
label: "Hebén",
|
|
50
|
+
members: [
|
|
51
|
+
226805,
|
|
52
|
+
190426,
|
|
53
|
+
58160,
|
|
54
|
+
12331,
|
|
55
|
+
11229,
|
|
56
|
+
9351
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
at: [62, 410],
|
|
61
|
+
id: "muscat",
|
|
62
|
+
label: "Muscat blanc",
|
|
63
|
+
members: [
|
|
64
|
+
30218,
|
|
65
|
+
24834,
|
|
66
|
+
13493,
|
|
67
|
+
12531,
|
|
68
|
+
9558,
|
|
69
|
+
9482,
|
|
70
|
+
8941,
|
|
71
|
+
7914
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
links: [
|
|
76
|
+
["savagnin", "heunisch"],
|
|
77
|
+
["cabfranc", "savagnin"],
|
|
78
|
+
["heben", "savagnin"],
|
|
79
|
+
["heunisch", "muscat"]
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
//#endregion
|
|
83
|
+
export { e as clusterFieldDemo };
|
|
@@ -0,0 +1,173 @@
|
|
|
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 { clamp as i, noteOf as a, noteSpace as o, sansWidth as s, stagger as c, sum as l } from "../util.js";
|
|
6
|
+
import { DimGroup as u, HitCircle as d, TipText as f } from "../hover.js";
|
|
7
|
+
import { Dot as p, Ring as m } from "../markers.js";
|
|
8
|
+
import { FootNote as h } from "../plot-note.js";
|
|
9
|
+
import { ChartSvg as g } from "../svg.js";
|
|
10
|
+
import { Label as _ } from "../text.js";
|
|
11
|
+
import { clusterFieldDemo as v } from "./cluster-field.data.js";
|
|
12
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
13
|
+
//#region src/charts/lupi/cluster-field.tsx
|
|
14
|
+
var x = (e, t) => t ? 150 : 14 + 7 * Math.sqrt(e.members.length), S = 34, C = (e, t, n) => {
|
|
15
|
+
let r = t.map((e, t) => {
|
|
16
|
+
let r = e.id === n, [i, a] = e.at ?? [t * 120, 0];
|
|
17
|
+
return {
|
|
18
|
+
cluster: e,
|
|
19
|
+
core: r,
|
|
20
|
+
fx: i,
|
|
21
|
+
fy: a,
|
|
22
|
+
r: x(e, r)
|
|
23
|
+
};
|
|
24
|
+
}), i = r.map((e) => s(`${e.cluster.label} · ${e.cluster.members.length}`, 11) / 2), a = (e) => {
|
|
25
|
+
let t = r.map((t, n) => Math.max(t.r * e + 4, i[n]));
|
|
26
|
+
return {
|
|
27
|
+
hi: Math.max(...r.map((n, r) => n.fx * e + t[r])),
|
|
28
|
+
lo: Math.min(...r.map((n, r) => n.fx * e - t[r]))
|
|
29
|
+
};
|
|
30
|
+
}, [o, c] = [.01, 8];
|
|
31
|
+
for (let t = 0; t < 40; t += 1) {
|
|
32
|
+
let t = (o + c) / 2, n = a(t);
|
|
33
|
+
n.hi - n.lo > e ? c = t : o = t;
|
|
34
|
+
}
|
|
35
|
+
let l = o, { lo: u } = a(l), d = Math.min(...r.map((e) => e.fy - e.r)), f = Math.max(...r.map((e) => e.fy + e.r)), p = r.map((e) => ({
|
|
36
|
+
R: e.r * l,
|
|
37
|
+
cluster: e.cluster,
|
|
38
|
+
core: e.core,
|
|
39
|
+
x: e.fx * l - u,
|
|
40
|
+
y: (e.fy - d) * l + 4
|
|
41
|
+
}));
|
|
42
|
+
return {
|
|
43
|
+
height: Math.round((f - d) * l + 4 + S),
|
|
44
|
+
placed: p,
|
|
45
|
+
s: l
|
|
46
|
+
};
|
|
47
|
+
}, w = (e, t) => t === 0 ? e : w(t, e % t), T = (e) => {
|
|
48
|
+
let t = Math.round(e * (1 - 2 / (1 + Math.sqrt(5))));
|
|
49
|
+
return Array.from({ length: e }, (e, t) => t + 1).filter((t) => w(t, e) === 1).toSorted((e, n) => Math.abs(e - t) - Math.abs(n - t))[0] ?? 1;
|
|
50
|
+
}, E = (e) => {
|
|
51
|
+
let t = e.cluster.members.length, n = T(t), r = e.core ? .28 : .38;
|
|
52
|
+
return e.cluster.members.map((i, a) => {
|
|
53
|
+
let o = a * n % t / t * 2 * Math.PI, s = e.R * (r + (1 - r) * Math.sqrt((a + .5) / t));
|
|
54
|
+
return {
|
|
55
|
+
id: `${e.cluster.id}-${a}`,
|
|
56
|
+
k: a,
|
|
57
|
+
size: i,
|
|
58
|
+
x: e.x + Math.sin(o) * s,
|
|
59
|
+
y: e.y - Math.cos(o) * s
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}, D = (e) => {
|
|
63
|
+
let { p: t } = e, n = i(e.s + .25, .7, 1.2);
|
|
64
|
+
return /* @__PURE__ */ b(u, {
|
|
65
|
+
dim: e.dim,
|
|
66
|
+
onPointerEnter: e.onEnter,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ y(d, {
|
|
69
|
+
cx: t.x,
|
|
70
|
+
cy: t.y,
|
|
71
|
+
r: t.R
|
|
72
|
+
}),
|
|
73
|
+
E(t).map((r) => /* @__PURE__ */ b("g", { children: [/* @__PURE__ */ y("line", {
|
|
74
|
+
className: "draw stroke-l6",
|
|
75
|
+
pathLength: 1,
|
|
76
|
+
strokeWidth: 1,
|
|
77
|
+
style: c(r.k, "dense"),
|
|
78
|
+
x1: t.x,
|
|
79
|
+
x2: r.x,
|
|
80
|
+
y1: t.y,
|
|
81
|
+
y2: r.y
|
|
82
|
+
}), /* @__PURE__ */ y("circle", {
|
|
83
|
+
className: `pop ${t.core ? "fill-l3" : "fill-l4"}`,
|
|
84
|
+
cx: r.x,
|
|
85
|
+
cy: r.y,
|
|
86
|
+
r: (.9 + 2.25 * Math.sqrt(r.size / e.maxSize)) * n,
|
|
87
|
+
style: c(r.k, "dense")
|
|
88
|
+
})] }, r.id)),
|
|
89
|
+
t.core ? /* @__PURE__ */ y(p, {
|
|
90
|
+
className: "pop fill-hero",
|
|
91
|
+
cx: t.x,
|
|
92
|
+
cy: t.y,
|
|
93
|
+
size: "lg"
|
|
94
|
+
}) : /* @__PURE__ */ y(m, {
|
|
95
|
+
className: "pop stroke-l2",
|
|
96
|
+
cx: t.x,
|
|
97
|
+
cy: t.y,
|
|
98
|
+
size: "sm"
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ b(_, {
|
|
101
|
+
anchor: "middle",
|
|
102
|
+
className: "fade",
|
|
103
|
+
muted: !t.core,
|
|
104
|
+
voice: "label",
|
|
105
|
+
x: t.x,
|
|
106
|
+
y: t.y + t.R + 22,
|
|
107
|
+
children: [
|
|
108
|
+
t.cluster.label,
|
|
109
|
+
" · ",
|
|
110
|
+
t.cluster.members.length
|
|
111
|
+
]
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
});
|
|
115
|
+
}, O = (e) => {
|
|
116
|
+
let t = new Map(e.placed.map((e) => [e.cluster.id, e]));
|
|
117
|
+
return /* @__PURE__ */ y("g", {
|
|
118
|
+
className: "fade",
|
|
119
|
+
children: e.links.map(([e, n]) => {
|
|
120
|
+
let r = t.get(e), i = t.get(n);
|
|
121
|
+
if (r === void 0 || i === void 0) return null;
|
|
122
|
+
let a = (r.x + i.x) / 2, o = (r.y + i.y) / 2, s = a - (i.y - r.y) * .12, c = o + (i.x - r.x) * .12;
|
|
123
|
+
return /* @__PURE__ */ y("path", {
|
|
124
|
+
className: "stroke-l6",
|
|
125
|
+
d: `M${r.x},${r.y}Q${s},${c} ${i.x},${i.y}`,
|
|
126
|
+
fill: "none",
|
|
127
|
+
strokeWidth: 1.5
|
|
128
|
+
}, `${e}-${n}`);
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
}, k = (i) => {
|
|
132
|
+
let s = i.data ?? v, c = s.clusters.toSorted((e, t) => t.members.length - e.members.length).at(0), u = c === void 0 ? "" : c.id, d = i.noun ?? "variety", p = i.sizeNoun ?? "ha", m = i.nouns ?? "varieties", _ = Math.max(1, ...s.clusters.flatMap((e) => e.members)), x = t(), S = x.key === null ? void 0 : s.clusters.find((e) => e.id === x.key);
|
|
133
|
+
return /* @__PURE__ */ y(n, {
|
|
134
|
+
overlay: x.at === null || S === void 0 ? null : /* @__PURE__ */ y(r, {
|
|
135
|
+
x: x.at.x,
|
|
136
|
+
y: x.at.y,
|
|
137
|
+
children: /* @__PURE__ */ y(f, {
|
|
138
|
+
facts: [`${S.members.length} ${S.members.length === 1 ? d : m}`, `${e(l(S.members))} ${p}`],
|
|
139
|
+
lead: S.label
|
|
140
|
+
})
|
|
141
|
+
}),
|
|
142
|
+
children: (e) => {
|
|
143
|
+
let t = C(e, s.clusters, u), n = i.height ?? t.height + o(a(i), e - 16, 24);
|
|
144
|
+
return /* @__PURE__ */ b(g, {
|
|
145
|
+
height: n,
|
|
146
|
+
label: `Grape families: ${s.clusters.map((e) => `${e.label} ${e.members.length}`).join(", ")}`,
|
|
147
|
+
leave: x.clear,
|
|
148
|
+
title: "Grape families as a core cluster with satellite islands",
|
|
149
|
+
width: e,
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ y(O, {
|
|
152
|
+
links: s.links,
|
|
153
|
+
placed: t.placed
|
|
154
|
+
}),
|
|
155
|
+
t.placed.map((e) => /* @__PURE__ */ y(D, {
|
|
156
|
+
dim: x.dim(e.cluster.id),
|
|
157
|
+
maxSize: _,
|
|
158
|
+
onEnter: x.enter(e.cluster.id, e.x, e.y - e.R - 4),
|
|
159
|
+
p: e,
|
|
160
|
+
s: t.s
|
|
161
|
+
}, e.cluster.id)),
|
|
162
|
+
/* @__PURE__ */ y(h, {
|
|
163
|
+
height: n,
|
|
164
|
+
text: a(i),
|
|
165
|
+
width: e
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
export { k as ClusterField };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/charts/lupi/dot-cascade.data.ts
|
|
3
|
+
var e = [
|
|
4
|
+
{
|
|
5
|
+
label: "Morphy's",
|
|
6
|
+
value: 7133
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
label: "Anastasia's",
|
|
10
|
+
value: 7524
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
label: "Arabian",
|
|
14
|
+
value: 7560
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: "Triangle",
|
|
18
|
+
value: 7741
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: "Swallow's tail",
|
|
22
|
+
value: 8397
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "Hook",
|
|
26
|
+
value: 10729
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: "Corner",
|
|
30
|
+
value: 10782
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "Epaulette",
|
|
34
|
+
value: 22646
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "Smothered",
|
|
38
|
+
value: 24332
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: "Opera",
|
|
42
|
+
value: 63940
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: "Pillsbury's",
|
|
46
|
+
value: 67644
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: "Back rank",
|
|
50
|
+
value: 208093
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
//#endregion
|
|
54
|
+
export { e as dotCascadeDemo };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { fmtKInt 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 { clamp as i, noteOf as a, noteSpace as o, sansWidth as s, stagger as c } from "../util.js";
|
|
6
|
+
import { DimGroup as l, HitRect as u, TipText as d } from "../hover.js";
|
|
7
|
+
import { FootNote as f } from "../plot-note.js";
|
|
8
|
+
import { ChartSvg as p } from "../svg.js";
|
|
9
|
+
import { Label as m } from "../text.js";
|
|
10
|
+
import { PixelLine as h } from "../texture.js";
|
|
11
|
+
import { dotCascadeDemo as g } from "./dot-cascade.data.js";
|
|
12
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
13
|
+
//#region src/charts/lupi/dot-cascade.tsx
|
|
14
|
+
var y = (e, t, n, r, a) => {
|
|
15
|
+
let o = i((e - 40) / n.length, 16, 38), c = (e - o * n.length) / 2 + o / 2, l = (e) => c + e * o, u = Math.max(0, ...r.map((e, t) => 10 + s(e, 11) - (l(t) - c) * .32)), d = t - 6 - a - u, f = (e) => d - (e - c) * .32, p = n.map((e, t) => e > 1 ? (f(l(t)) - 14 - 34) / (e - 1) : 99), m = Math.floor(i(Math.min(...p), 4, 10)), h = Math.max(0, Math.min(...n.map((e, t) => f(l(t)) - 14 - (e - 1) * m - 34)));
|
|
16
|
+
return {
|
|
17
|
+
capW: Math.round(Math.min(o * .6, 14)),
|
|
18
|
+
colX: l,
|
|
19
|
+
dy: m,
|
|
20
|
+
floorY: (e) => f(e) - h,
|
|
21
|
+
gap: 14,
|
|
22
|
+
height: t - h,
|
|
23
|
+
pitch: o,
|
|
24
|
+
tickW: Math.round(Math.min(o * .4, 9))
|
|
25
|
+
};
|
|
26
|
+
}, b = ({ count: e, datum: t, dim: n, format: r, hero: i, i: a, layout: o, onEnter: s }) => {
|
|
27
|
+
let { capW: d, colX: f, dy: p, floorY: h, gap: g, pitch: y, tickW: b } = o, x = f(a), S = Math.round(h(x) - g), C = S - (e - 1) * p, w = Array.from({ length: e - 1 }, (e, t) => t);
|
|
28
|
+
return /* @__PURE__ */ v(l, {
|
|
29
|
+
dim: n,
|
|
30
|
+
onPointerEnter: () => {
|
|
31
|
+
s(x, C - 22);
|
|
32
|
+
},
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ _(u, {
|
|
35
|
+
height: h(x) - C + 70,
|
|
36
|
+
width: y,
|
|
37
|
+
x: x - y / 2,
|
|
38
|
+
y: C - 26
|
|
39
|
+
}),
|
|
40
|
+
w.map((e) => /* @__PURE__ */ _("rect", {
|
|
41
|
+
className: `pop ${i ? "fill-l3" : "fill-l5"}`,
|
|
42
|
+
height: 1,
|
|
43
|
+
style: c(a * 2 + e, "fine"),
|
|
44
|
+
width: b,
|
|
45
|
+
x: Math.round(x - b / 2),
|
|
46
|
+
y: S - e * p
|
|
47
|
+
}, `${t.label}-${e}`)),
|
|
48
|
+
/* @__PURE__ */ _("rect", {
|
|
49
|
+
className: `pop ${i ? "fill-hero" : "fill-l3"}`,
|
|
50
|
+
height: 2,
|
|
51
|
+
style: c(a * 2 + e, "fine"),
|
|
52
|
+
width: d,
|
|
53
|
+
x: Math.round(x - d / 2),
|
|
54
|
+
y: C - 1
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ _(m, {
|
|
57
|
+
anchor: "middle",
|
|
58
|
+
order: a,
|
|
59
|
+
tier: "mark",
|
|
60
|
+
voice: i ? "value" : "axis",
|
|
61
|
+
x,
|
|
62
|
+
y: C - 9,
|
|
63
|
+
children: r(t.value)
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ _(m, {
|
|
66
|
+
anchor: "end",
|
|
67
|
+
middle: !0,
|
|
68
|
+
muted: !0,
|
|
69
|
+
transform: `translate(${x},${h(x) + 10}) rotate(-90)`,
|
|
70
|
+
voice: "label",
|
|
71
|
+
children: t.label
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
}, x = (i) => {
|
|
76
|
+
let s = i.data ?? g, c = i.sort === !1 ? s : s.toSorted((e, t) => e.value - t.value), l = i.unit ?? 1e4, u = i.height ?? 440, m = i.format ?? e, x = i.noun ?? "puzzles", S = t(), C = i.highlight ?? c.at(-1)?.label, w = c.map((e) => Math.max(1, Math.ceil(e.value / l)));
|
|
77
|
+
return /* @__PURE__ */ _(n, {
|
|
78
|
+
overlay: S.at === null ? null : /* @__PURE__ */ _(r, {
|
|
79
|
+
x: S.at.x,
|
|
80
|
+
y: S.at.y,
|
|
81
|
+
children: /* @__PURE__ */ _(d, {
|
|
82
|
+
facts: [`${m(c[S.at.key].value)} ${x}`],
|
|
83
|
+
lead: c[S.at.key].label
|
|
84
|
+
})
|
|
85
|
+
}),
|
|
86
|
+
children: (e) => {
|
|
87
|
+
let t = y(e, u, w, c.map((e) => e.label), o(a(i), e - 16, 20)), n = t.colX(0) - t.pitch * .7, r = t.colX(c.length - 1) + t.pitch * .7;
|
|
88
|
+
return /* @__PURE__ */ v(p, {
|
|
89
|
+
height: t.height,
|
|
90
|
+
label: `Puzzles by mate: ${c.map((e) => `${e.label} ${m(e.value)}`).join(", ")}`,
|
|
91
|
+
leave: S.clear,
|
|
92
|
+
title: "Puzzles by named mate as stacked unit ticks",
|
|
93
|
+
width: e,
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ _(h, {
|
|
96
|
+
className: "fade",
|
|
97
|
+
tone: "fill-l5",
|
|
98
|
+
x0: n,
|
|
99
|
+
x1: r,
|
|
100
|
+
y0: t.floorY(n),
|
|
101
|
+
y1: t.floorY(r)
|
|
102
|
+
}),
|
|
103
|
+
c.map((e, n) => /* @__PURE__ */ _(b, {
|
|
104
|
+
count: w[n],
|
|
105
|
+
datum: e,
|
|
106
|
+
dim: S.dim(n),
|
|
107
|
+
format: m,
|
|
108
|
+
hero: C === e.label,
|
|
109
|
+
i: n,
|
|
110
|
+
layout: t,
|
|
111
|
+
onEnter: S.showAt(n)
|
|
112
|
+
}, e.label)),
|
|
113
|
+
/* @__PURE__ */ _(f, {
|
|
114
|
+
height: t.height,
|
|
115
|
+
text: a(i),
|
|
116
|
+
width: e
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
//#endregion
|
|
124
|
+
export { x as DotCascade };
|