@howells/hairline 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- 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 +36 -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 +160 -3
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Plot as e } from "../core.js";
|
|
3
|
+
import { rndSigned as t } from "../../lib/random.js";
|
|
4
|
+
import { noteOf as n, noteSpace as r, sansWidth as i, stagger as a } from "../util.js";
|
|
5
|
+
import { HitRect as o } from "../hover.js";
|
|
6
|
+
import { LABEL_TICK as s } from "../marks.js";
|
|
7
|
+
import { Dot as c, Ring as l } from "../markers.js";
|
|
8
|
+
import { FootNote as u } from "../plot-note.js";
|
|
9
|
+
import { ChartSvg as d } from "../svg.js";
|
|
10
|
+
import { Label as f } from "../text.js";
|
|
11
|
+
import { DottedLine as p } from "../texture.js";
|
|
12
|
+
import { threadTriptychDemo as m } from "./thread-triptych.data.js";
|
|
13
|
+
import { useEffect as h, useMemo as g, useState as _ } from "react";
|
|
14
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
15
|
+
//#region src/charts/big/thread-triptych.tsx
|
|
16
|
+
var x = 12, S = 29, C = 18, w = 46, T = 14, E = 44, D = (e, t) => `${e}:${t}`, O = (e, t) => {
|
|
17
|
+
let n = /* @__PURE__ */ new Map();
|
|
18
|
+
for (let r of e) {
|
|
19
|
+
let e = r.stops[t] ?? "";
|
|
20
|
+
n.set(e, (n.get(e) ?? 0) + 1);
|
|
21
|
+
}
|
|
22
|
+
return [...n].toSorted((e, t) => t[1] - e[1])[0]?.[0] ?? "";
|
|
23
|
+
}, k = (e, t, n) => new Map(e.map((r, i) => [r, e.length === 1 ? (t + n) / 2 : t + (n - t) * i / (e.length - 1)])), A = (e, t, n, r) => new Map(e.map((e) => {
|
|
24
|
+
let i = [...new Set(t.flatMap((t) => t.stops[n] === e ? [t.stops[n - 1] ?? ""] : []))].map((e) => r.get(e) ?? w);
|
|
25
|
+
return [e, i.reduce((e, t) => e + t, 0) / Math.max(1, i.length)];
|
|
26
|
+
})), j = (e) => Math.min(E, ...e.slice(1).map((t, n) => Math.abs(t - (e[n] ?? t)))), M = (e) => Math.ceil(Math.max(0, ...e.map((e) => i(e, 12)))), N = (e, n, r) => {
|
|
27
|
+
let i = e.columns.length - 1, a = M(e.columns[0] ?? []) + T - .5, o = n - M(e.columns[i] ?? []) - T + 1.5, s = e.columns.map((e, t) => a + (o - a) * t / i), c = [];
|
|
28
|
+
for (let [t, n] of e.columns.entries()) c.push(t === 0 ? k(n, w, r) : A(n, e.paths, t, c[t - 1] ?? /* @__PURE__ */ new Map()));
|
|
29
|
+
let l = c.flatMap((e, t) => [...e].map(([e, n], r) => ({
|
|
30
|
+
column: t,
|
|
31
|
+
index: r,
|
|
32
|
+
key: D(t, e),
|
|
33
|
+
name: e,
|
|
34
|
+
y: n
|
|
35
|
+
}))), u = Math.min(18, n * .012), d = e.paths.map((e, n) => {
|
|
36
|
+
let r = (t) => c[t]?.get(e.stops[t] ?? "") ?? w, i = s.slice(1).map((e, i) => {
|
|
37
|
+
let o = ((s[i] ?? a) + e) / 2 + t(n, 5 + i * 4) * u;
|
|
38
|
+
return `C${o},${r(i)} ${o},${r(i + 1)} ${e},${r(i + 1)}`;
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
d: `M${a + 4},${r(0)}${i.join("")}`,
|
|
42
|
+
path: e
|
|
43
|
+
};
|
|
44
|
+
}), f = c.map((e) => j([...e.values()]));
|
|
45
|
+
return {
|
|
46
|
+
every: f.map((e) => Math.max(1, Math.ceil(C / e))),
|
|
47
|
+
hero: O(e.paths, i),
|
|
48
|
+
pitch: f,
|
|
49
|
+
stops: l,
|
|
50
|
+
threads: d,
|
|
51
|
+
wide: n >= 640,
|
|
52
|
+
xs: s
|
|
53
|
+
};
|
|
54
|
+
}, P = (e, t) => t.kind === "thread" ? e.id === t.id : e.stops[t.column] === t.name, F = (e, t) => e === null || t === null ? e === t : e.kind === "thread" && t.kind === "thread" ? e.id === t.id : e.kind === "node" && t.kind === "node" && e.column === t.column && e.name === t.name, I = .16, L = (e) => /* @__PURE__ */ b("g", {
|
|
55
|
+
className: "transition-opacity group-data-[focus=true]/threads:opacity-30",
|
|
56
|
+
fill: "none",
|
|
57
|
+
children: [e.threads.map((e, t) => /* @__PURE__ */ y("path", {
|
|
58
|
+
className: "draw stroke-ink cap-round",
|
|
59
|
+
d: e.d,
|
|
60
|
+
pathLength: 1,
|
|
61
|
+
strokeOpacity: I,
|
|
62
|
+
strokeWidth: 1.5,
|
|
63
|
+
style: a(t * .5, "dense")
|
|
64
|
+
}, e.path.id)), e.threads.map((e) => /* @__PURE__ */ y("path", {
|
|
65
|
+
className: "cursor-pointer stroke-transparent",
|
|
66
|
+
d: e.d,
|
|
67
|
+
"data-thread": e.path.id,
|
|
68
|
+
strokeWidth: 7
|
|
69
|
+
}, `hit-${e.path.id}`))]
|
|
70
|
+
}), R = (e, t) => e ? "fill-ink" : t, z = (e) => {
|
|
71
|
+
let { stop: t, x: n } = e;
|
|
72
|
+
return /* @__PURE__ */ b(v, { children: [e.hero ? /* @__PURE__ */ y(c, {
|
|
73
|
+
className: "fill-hero",
|
|
74
|
+
cx: n,
|
|
75
|
+
cy: t.y,
|
|
76
|
+
size: "md"
|
|
77
|
+
}) : /* @__PURE__ */ y(l, {
|
|
78
|
+
className: `transition-tone ${e.bright ? "stroke-ink" : "stroke-l3"}`,
|
|
79
|
+
cx: n,
|
|
80
|
+
cy: t.y,
|
|
81
|
+
size: "md"
|
|
82
|
+
}), /* @__PURE__ */ y(f, {
|
|
83
|
+
className: R(e.bright || e.hero, "fill-text"),
|
|
84
|
+
dy: "0.35em",
|
|
85
|
+
voice: "label",
|
|
86
|
+
x: n + T,
|
|
87
|
+
y: t.y,
|
|
88
|
+
children: t.name
|
|
89
|
+
})] });
|
|
90
|
+
}, B = (e) => {
|
|
91
|
+
let { stop: t, triptych: n } = e, r = e.lit === !1 ? "opacity-30" : "", i = e.lit === !0, a = n.xs[t.column] ?? 0, o = Math.round(t.y) - 1;
|
|
92
|
+
if (t.column === 0) return /* @__PURE__ */ b("g", {
|
|
93
|
+
className: `transition-opacity ${r}`,
|
|
94
|
+
children: [/* @__PURE__ */ y("rect", {
|
|
95
|
+
className: R(i, "fill-l3"),
|
|
96
|
+
height: s.h,
|
|
97
|
+
width: s.w,
|
|
98
|
+
x: Math.round(a) - 2 - s.w,
|
|
99
|
+
y: o
|
|
100
|
+
}), /* @__PURE__ */ y(f, {
|
|
101
|
+
anchor: "end",
|
|
102
|
+
className: R(i, "fill-text"),
|
|
103
|
+
dy: "0.35em",
|
|
104
|
+
voice: "label",
|
|
105
|
+
x: a - T,
|
|
106
|
+
y: t.y,
|
|
107
|
+
children: t.name
|
|
108
|
+
})]
|
|
109
|
+
});
|
|
110
|
+
if (t.column < n.xs.length - 1) {
|
|
111
|
+
let e = n.every[t.column] ?? 1;
|
|
112
|
+
return /* @__PURE__ */ b("g", {
|
|
113
|
+
className: `transition-opacity ${r}`,
|
|
114
|
+
children: [/* @__PURE__ */ y("rect", {
|
|
115
|
+
className: R(i, "fill-l3"),
|
|
116
|
+
height: s.h,
|
|
117
|
+
width: s.w,
|
|
118
|
+
x: Math.round(a) - s.w / 2,
|
|
119
|
+
y: o
|
|
120
|
+
}), (n.wide && t.index % e === 0 || i) && /* @__PURE__ */ y(f, {
|
|
121
|
+
className: R(i, "fill-muted"),
|
|
122
|
+
dy: "0.35em",
|
|
123
|
+
halo: !0,
|
|
124
|
+
voice: "axis",
|
|
125
|
+
x: a + 9,
|
|
126
|
+
y: t.y,
|
|
127
|
+
children: t.name
|
|
128
|
+
})]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return /* @__PURE__ */ y("g", {
|
|
132
|
+
className: `transition-opacity ${r}`,
|
|
133
|
+
children: /* @__PURE__ */ y(z, {
|
|
134
|
+
bright: i,
|
|
135
|
+
hero: t.name === n.hero,
|
|
136
|
+
stop: t,
|
|
137
|
+
x: a
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
}, V = (e, t) => {
|
|
141
|
+
let n = t.xs[e.column] ?? 0;
|
|
142
|
+
return e.column === 0 ? {
|
|
143
|
+
width: n - 4,
|
|
144
|
+
x: 0
|
|
145
|
+
} : e.column < t.xs.length - 1 ? {
|
|
146
|
+
width: 70,
|
|
147
|
+
x: n - 6
|
|
148
|
+
} : {
|
|
149
|
+
width: 110,
|
|
150
|
+
x: n - 8
|
|
151
|
+
};
|
|
152
|
+
}, H = (e) => {
|
|
153
|
+
let { lit: t, triptych: n } = e;
|
|
154
|
+
return /* @__PURE__ */ y("g", { children: n.stops.map((e) => {
|
|
155
|
+
let r = n.pitch[e.column] ?? E;
|
|
156
|
+
return /* @__PURE__ */ b("g", {
|
|
157
|
+
className: "cursor-pointer",
|
|
158
|
+
children: [/* @__PURE__ */ y(o, {
|
|
159
|
+
"data-stop": e.key,
|
|
160
|
+
height: r,
|
|
161
|
+
y: e.y - r / 2,
|
|
162
|
+
...V(e, n)
|
|
163
|
+
}), /* @__PURE__ */ y("g", {
|
|
164
|
+
className: "pointer-events-none",
|
|
165
|
+
children: /* @__PURE__ */ y(B, {
|
|
166
|
+
lit: t === null ? null : t.has(e.key),
|
|
167
|
+
stop: e,
|
|
168
|
+
triptych: n
|
|
169
|
+
})
|
|
170
|
+
})]
|
|
171
|
+
}, e.key);
|
|
172
|
+
}) });
|
|
173
|
+
}, U = (e, t) => new Set(e.map((e) => e.stops[t])).size, W = (e) => /* @__PURE__ */ b(f, {
|
|
174
|
+
anchor: e.anchor,
|
|
175
|
+
className: "fade",
|
|
176
|
+
muted: !0,
|
|
177
|
+
voice: "label",
|
|
178
|
+
x: e.x,
|
|
179
|
+
y: e.y,
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ y("tspan", { children: e.label }),
|
|
182
|
+
" ",
|
|
183
|
+
/* @__PURE__ */ y("tspan", {
|
|
184
|
+
className: "t-value",
|
|
185
|
+
children: e.count
|
|
186
|
+
})
|
|
187
|
+
]
|
|
188
|
+
}), G = (e) => {
|
|
189
|
+
let { wide: t, xs: n } = e.triptych, r = n.length - 1, a = (a, o) => {
|
|
190
|
+
let s = n[a] ?? 0;
|
|
191
|
+
if (a === 0) return {
|
|
192
|
+
anchor: "end",
|
|
193
|
+
x: s - T,
|
|
194
|
+
y: x
|
|
195
|
+
};
|
|
196
|
+
if (a < r) return t ? {
|
|
197
|
+
anchor: "start",
|
|
198
|
+
x: s + 9,
|
|
199
|
+
y: x
|
|
200
|
+
} : {
|
|
201
|
+
anchor: "middle",
|
|
202
|
+
x: s,
|
|
203
|
+
y: a % 2 == 0 ? S : x
|
|
204
|
+
};
|
|
205
|
+
let c = Math.ceil(i(`${o} ${U(e.paths, a)}`, 12));
|
|
206
|
+
return {
|
|
207
|
+
anchor: "start",
|
|
208
|
+
x: Math.min(s + T, e.width - c - 2),
|
|
209
|
+
y: x
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
return /* @__PURE__ */ y("g", {
|
|
213
|
+
"aria-live": "polite",
|
|
214
|
+
children: n.map((t, n) => {
|
|
215
|
+
let r = e.headings[n] ?? "";
|
|
216
|
+
return /* @__PURE__ */ y(W, {
|
|
217
|
+
count: U(e.paths, n),
|
|
218
|
+
label: r,
|
|
219
|
+
...a(n, r)
|
|
220
|
+
}, r);
|
|
221
|
+
})
|
|
222
|
+
});
|
|
223
|
+
}, K = (e, t) => {
|
|
224
|
+
let { target: n } = e;
|
|
225
|
+
if (!(n instanceof SVGElement)) return null;
|
|
226
|
+
let { thread: r } = n.dataset;
|
|
227
|
+
if (r !== void 0) return {
|
|
228
|
+
id: r,
|
|
229
|
+
kind: "thread"
|
|
230
|
+
};
|
|
231
|
+
let i = t.stops.find((e) => e.key === n.dataset.stop);
|
|
232
|
+
return i === void 0 ? null : {
|
|
233
|
+
column: i.column,
|
|
234
|
+
kind: "node",
|
|
235
|
+
name: i.name
|
|
236
|
+
};
|
|
237
|
+
}, q = (e, t) => {
|
|
238
|
+
h(() => {
|
|
239
|
+
let n = (e) => {
|
|
240
|
+
e.key === "Escape" && t();
|
|
241
|
+
};
|
|
242
|
+
return e && window.addEventListener("keydown", n), () => {
|
|
243
|
+
window.removeEventListener("keydown", n);
|
|
244
|
+
};
|
|
245
|
+
}, [e, t]);
|
|
246
|
+
}, J = (e) => /* @__PURE__ */ y("g", {
|
|
247
|
+
className: "fade",
|
|
248
|
+
children: e.triptych.xs.slice(1, -1).map((t) => /* @__PURE__ */ y(p, {
|
|
249
|
+
tone: "fill-l5",
|
|
250
|
+
x0: t,
|
|
251
|
+
x1: t,
|
|
252
|
+
y0: 40,
|
|
253
|
+
y1: e.floor + 2
|
|
254
|
+
}, t))
|
|
255
|
+
}), Y = (e) => {
|
|
256
|
+
let { data: t, focus: n, height: i, note: a, width: s } = e, c = i - 16 - r(a, s - 16, 18), l = g(() => N(t, s, c), [
|
|
257
|
+
t,
|
|
258
|
+
s,
|
|
259
|
+
c
|
|
260
|
+
]), f = g(() => /* @__PURE__ */ y(L, { threads: l.threads }), [l]), p = n === null ? [] : l.threads.filter((e) => P(e.path, n)), m = n === null ? null : new Set(p.flatMap((e) => e.path.stops.map((e, t) => D(t, e)))), h = `Mammal tree: ${t.columns.map((t, n) => `${t.length} ${(e.headings[n] ?? "").toLowerCase()}`).join(" in ")}`;
|
|
261
|
+
return /* @__PURE__ */ b(d, {
|
|
262
|
+
className: "group/threads",
|
|
263
|
+
"data-focus": n !== null,
|
|
264
|
+
height: i,
|
|
265
|
+
label: h,
|
|
266
|
+
leave: () => {
|
|
267
|
+
e.onHover(null);
|
|
268
|
+
},
|
|
269
|
+
onPointerMove: (t) => {
|
|
270
|
+
e.onHover(K(t, l));
|
|
271
|
+
},
|
|
272
|
+
onPointerUp: (t) => {
|
|
273
|
+
e.onPin(K(t, l));
|
|
274
|
+
},
|
|
275
|
+
width: s,
|
|
276
|
+
children: [
|
|
277
|
+
/* @__PURE__ */ y(o, {
|
|
278
|
+
height: i,
|
|
279
|
+
width: s
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ y(G, {
|
|
282
|
+
headings: e.headings,
|
|
283
|
+
paths: n === null ? t.paths : p.map((e) => e.path),
|
|
284
|
+
triptych: l,
|
|
285
|
+
width: s
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ y(J, {
|
|
288
|
+
floor: c,
|
|
289
|
+
triptych: l
|
|
290
|
+
}),
|
|
291
|
+
f,
|
|
292
|
+
/* @__PURE__ */ y("g", {
|
|
293
|
+
className: "stroke-ink cap-round pointer-events-none",
|
|
294
|
+
fill: "none",
|
|
295
|
+
strokeWidth: 1.5,
|
|
296
|
+
children: p.map((e) => /* @__PURE__ */ y("path", { d: e.d }, e.path.id))
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ y(H, {
|
|
299
|
+
lit: m,
|
|
300
|
+
triptych: l
|
|
301
|
+
}),
|
|
302
|
+
/* @__PURE__ */ y(u, {
|
|
303
|
+
height: i,
|
|
304
|
+
text: a,
|
|
305
|
+
width: s
|
|
306
|
+
})
|
|
307
|
+
]
|
|
308
|
+
});
|
|
309
|
+
}, X = (t) => {
|
|
310
|
+
let r = t.data ?? m, [i, a] = _(null), [o, s] = _(null), c = o ?? i, l = g(() => () => {
|
|
311
|
+
s(null);
|
|
312
|
+
}, []);
|
|
313
|
+
return q(o !== null, l), /* @__PURE__ */ y(e, { children: (e) => /* @__PURE__ */ y(Y, {
|
|
314
|
+
data: r,
|
|
315
|
+
focus: c,
|
|
316
|
+
headings: t.headings ?? [
|
|
317
|
+
"Genera",
|
|
318
|
+
"Families",
|
|
319
|
+
"Orders",
|
|
320
|
+
"Superorders"
|
|
321
|
+
],
|
|
322
|
+
height: t.height ?? 560,
|
|
323
|
+
note: n(t),
|
|
324
|
+
onHover: (e) => {
|
|
325
|
+
a((t) => F(t, e) ? t : e);
|
|
326
|
+
},
|
|
327
|
+
onPin: (e) => {
|
|
328
|
+
s((t) => e === null || F(t, e) ? null : e);
|
|
329
|
+
},
|
|
330
|
+
width: e
|
|
331
|
+
}) });
|
|
332
|
+
};
|
|
333
|
+
//#endregion
|
|
334
|
+
export { X as ThreadTriptych };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { plural as e } from "../../lib/format.js";
|
|
3
|
+
import { resolveFormat as t } from "../../schema/format.js";
|
|
4
|
+
import { keyOf as n } from "../../schema/key.js";
|
|
5
|
+
import { useHover as r } from "../hooks.js";
|
|
6
|
+
import { VALUE as i } from "../roles.js";
|
|
7
|
+
import { Plot as a } from "../core.js";
|
|
8
|
+
import { stagger as o } from "../util.js";
|
|
9
|
+
import { DimGroup as s } from "../hover.js";
|
|
10
|
+
import { Dot as c, Ring as l } from "../markers.js";
|
|
11
|
+
import { VRule as u } from "../rules.js";
|
|
12
|
+
import { chartTable as d, plotOptions as f, scoped as p } from "../shared-options.js";
|
|
13
|
+
import { ChartSvg as m } from "../svg.js";
|
|
14
|
+
import { Label as h } from "../text.js";
|
|
15
|
+
import { nameWidth as g } from "./room.js";
|
|
16
|
+
import { relax as _ } from "./spread.js";
|
|
17
|
+
import { scaleLinear as v } from "d3-scale";
|
|
18
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
19
|
+
//#region src/charts/board/slope.tsx
|
|
20
|
+
var x = (e) => e.xs.map((t, n) => /* @__PURE__ */ b("g", { children: [/* @__PURE__ */ y(u, {
|
|
21
|
+
kind: "grid",
|
|
22
|
+
x: t,
|
|
23
|
+
y0: e.top,
|
|
24
|
+
y1: e.height
|
|
25
|
+
}), /* @__PURE__ */ y(h, {
|
|
26
|
+
anchor: "middle",
|
|
27
|
+
voice: "axis",
|
|
28
|
+
x: t,
|
|
29
|
+
y: e.top - 14,
|
|
30
|
+
children: e.labels[n]
|
|
31
|
+
})] }, t)), S = 1, C = 520, w = 14, T = {
|
|
32
|
+
lead: {
|
|
33
|
+
dotClass: "fill-hero",
|
|
34
|
+
ringClass: "stroke-hero",
|
|
35
|
+
stroke: "var(--hl-hero)",
|
|
36
|
+
value: "fill-ink"
|
|
37
|
+
},
|
|
38
|
+
rest: {
|
|
39
|
+
dotClass: "fill-l3",
|
|
40
|
+
ringClass: "stroke-l3",
|
|
41
|
+
stroke: "var(--hl-l3)",
|
|
42
|
+
value: "fill-muted"
|
|
43
|
+
},
|
|
44
|
+
worst: {
|
|
45
|
+
dotClass: "fill-alert",
|
|
46
|
+
ringClass: "stroke-alert",
|
|
47
|
+
stroke: "var(--hl-alert)",
|
|
48
|
+
value: "fill-ink"
|
|
49
|
+
}
|
|
50
|
+
}, E = (e) => {
|
|
51
|
+
let { i: t, row: n, y: r } = e, [a, u] = e.xs, d = T[e.role], f = `${i} ${d.value}`, { name: p } = n;
|
|
52
|
+
return /* @__PURE__ */ b(s, {
|
|
53
|
+
className: "fade",
|
|
54
|
+
dim: e.dim,
|
|
55
|
+
style: o(t),
|
|
56
|
+
onPointerEnter: e.onHover,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ y("line", {
|
|
59
|
+
x1: a,
|
|
60
|
+
x2: u,
|
|
61
|
+
y1: r(n.from),
|
|
62
|
+
y2: r(n.to),
|
|
63
|
+
stroke: "transparent",
|
|
64
|
+
strokeWidth: 14
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ y("line", {
|
|
67
|
+
className: "cap-round",
|
|
68
|
+
x1: a,
|
|
69
|
+
x2: u,
|
|
70
|
+
y1: r(n.from),
|
|
71
|
+
y2: r(n.to),
|
|
72
|
+
stroke: d.stroke,
|
|
73
|
+
strokeWidth: 1.5
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ y(l, {
|
|
76
|
+
className: d.ringClass,
|
|
77
|
+
cx: a,
|
|
78
|
+
cy: r(n.from),
|
|
79
|
+
size: "sm"
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ y(c, {
|
|
82
|
+
className: d.dotClass,
|
|
83
|
+
cx: u,
|
|
84
|
+
cy: r(n.to),
|
|
85
|
+
size: e.role === "rest" ? "sm" : "md"
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ b("text", {
|
|
88
|
+
x: a - w,
|
|
89
|
+
y: e.labelYs[0],
|
|
90
|
+
dy: "0.34em",
|
|
91
|
+
textAnchor: "end",
|
|
92
|
+
className: "t-label",
|
|
93
|
+
children: [/* @__PURE__ */ b("tspan", {
|
|
94
|
+
fill: "var(--hl-muted)",
|
|
95
|
+
children: [p, " "]
|
|
96
|
+
}), /* @__PURE__ */ y("tspan", {
|
|
97
|
+
className: f,
|
|
98
|
+
children: e.format(n.from)
|
|
99
|
+
})]
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ b("text", {
|
|
102
|
+
x: u + w,
|
|
103
|
+
y: e.labelYs[1],
|
|
104
|
+
dy: "0.34em",
|
|
105
|
+
className: "t-label",
|
|
106
|
+
children: [/* @__PURE__ */ y("tspan", {
|
|
107
|
+
className: f,
|
|
108
|
+
children: e.format(n.to)
|
|
109
|
+
}), /* @__PURE__ */ b("tspan", {
|
|
110
|
+
fill: "var(--hl-muted)",
|
|
111
|
+
children: [" ", p]
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
});
|
|
116
|
+
}, D = (e, t) => {
|
|
117
|
+
let n = (e) => e.to - e.from, r = Math.min(...t.map(n)), i = Math.max(...t.map(n));
|
|
118
|
+
return r < 0 && n(e) === r ? "lead" : i > 0 && n(e) === i ? "worst" : "rest";
|
|
119
|
+
}, O = (e) => {
|
|
120
|
+
let t = e.flatMap((e) => [e.from, e.to]), n = Math.min(...t), r = Math.max(...t);
|
|
121
|
+
return t.length === 0 ? [0, 1] : n === r ? [n - 1, r + 1] : [n, r];
|
|
122
|
+
}, k = (t, n, r) => {
|
|
123
|
+
if (t.length === 0) return "No data.";
|
|
124
|
+
let [i] = t, [a] = t;
|
|
125
|
+
for (let e of t) i = e.to - e.from > i.to - i.from ? e : i, a = e.to - e.from < a.to - a.from ? e : a;
|
|
126
|
+
return `${e(t.length, "line")} from ${n[0]} to ${n[1]}. Biggest rise: ${i.name}, ${r(i.from)} to ${r(i.to)}. Biggest fall: ${a.name}, ${r(a.from)} to ${r(a.to)}. The data table lists every line.`;
|
|
127
|
+
}, A = (e) => {
|
|
128
|
+
let i = (e.rows ?? []).filter((e) => Number.isFinite(e.from) && Number.isFinite(e.to)), o = e.height ?? 420, s = t(e.format), c = e.narrowFormat === void 0 ? s : t(e.narrowFormat), l = e.domain ?? O(i), u = r();
|
|
129
|
+
return /* @__PURE__ */ y(a, {
|
|
130
|
+
...f(e),
|
|
131
|
+
initialWidth: e.initialWidth,
|
|
132
|
+
table: d(e, e.title ?? e.label ?? "Change between two points", [
|
|
133
|
+
"Name",
|
|
134
|
+
e.labels[0],
|
|
135
|
+
e.labels[1]
|
|
136
|
+
], i.map((e) => [
|
|
137
|
+
e.name,
|
|
138
|
+
s(e.from),
|
|
139
|
+
s(e.to)
|
|
140
|
+
])),
|
|
141
|
+
width: e.width,
|
|
142
|
+
children: (t) => {
|
|
143
|
+
let r = t < C ? c : s, a = [w + g(i.map((e) => `${e.name} ${r(e.from)}`), S, e.metrics), t - w - 3 - g(i.map((e) => `${r(e.to)} ${e.name}`), S, e.metrics)], d = v().domain(l).range([o - 24, 56]), f = (e) => e.length === 0 ? e : _(e, 15, 48, o - 8), p = f(i.map((e) => d(e.from))), h = f(i.map((e) => d(e.to))), T = /* @__PURE__ */ new Map(), O = i.map((e) => {
|
|
144
|
+
let t = n(e), r = T.get(t) ?? 0;
|
|
145
|
+
return T.set(t, r + 1), `${t}#${r}`;
|
|
146
|
+
}), A = (t, n) => e.emphasis === void 0 ? D(t, i) : O[n] === `${e.emphasis}#0` ? "lead" : "rest", j = e.title ?? e.label ?? (i.length === 0 ? "No data" : i.map((t) => `${t.name} ${r(t.from)} ${e.labels[0]}, ${r(t.to)} ${e.labels[1]}`).join("; "));
|
|
147
|
+
return /* @__PURE__ */ b(m, {
|
|
148
|
+
desc: k(i, e.labels, r),
|
|
149
|
+
height: o,
|
|
150
|
+
label: j,
|
|
151
|
+
leave: u.clear,
|
|
152
|
+
width: t,
|
|
153
|
+
children: [/* @__PURE__ */ y(x, {
|
|
154
|
+
xs: a,
|
|
155
|
+
labels: e.labels,
|
|
156
|
+
top: 40,
|
|
157
|
+
height: o
|
|
158
|
+
}), i.map((e, t) => /* @__PURE__ */ y(E, {
|
|
159
|
+
row: e,
|
|
160
|
+
i: t,
|
|
161
|
+
xs: a,
|
|
162
|
+
labelYs: [p[t], h[t]],
|
|
163
|
+
y: d,
|
|
164
|
+
dim: u.dim(t),
|
|
165
|
+
role: A(e, t),
|
|
166
|
+
format: r,
|
|
167
|
+
onHover: () => {
|
|
168
|
+
u.show(t);
|
|
169
|
+
}
|
|
170
|
+
}, O[t]))]
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}, j = (e) => p(e.idPrefix, /* @__PURE__ */ y(A, { ...e }));
|
|
175
|
+
//#endregion
|
|
176
|
+
export { j as Slope };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/charts/board/spread.ts
|
|
3
|
+
var e = (e, t) => {
|
|
4
|
+
let n = !1;
|
|
5
|
+
for (let r = 1; r < e.length; r += 1) {
|
|
6
|
+
let i = t - (e[r].y - e[r - 1].y);
|
|
7
|
+
i > .1 && (e[r - 1].y -= i / 2, e[r].y += i / 2, n = !0);
|
|
8
|
+
}
|
|
9
|
+
return n;
|
|
10
|
+
}, t = (e, t, n, r) => {
|
|
11
|
+
let i = e.length - 1;
|
|
12
|
+
e[i].y = Math.min(e[i].y, r);
|
|
13
|
+
for (let n = i - 1; n >= 0; --n) e[n].y = Math.min(e[n].y, e[n + 1].y - t);
|
|
14
|
+
e[0].y = Math.max(e[0].y, n);
|
|
15
|
+
for (let n = 1; n <= i; n += 1) e[n].y = Math.max(e[n].y, e[n - 1].y + t);
|
|
16
|
+
}, n = (n, r, i, a) => {
|
|
17
|
+
let o = n.map((e, t) => ({
|
|
18
|
+
i: t,
|
|
19
|
+
y: e
|
|
20
|
+
})).toSorted((e, t) => e.y - t.y);
|
|
21
|
+
for (let t = 0; t < 40 && e(o, r); t += 1);
|
|
22
|
+
t(o, r, i, a);
|
|
23
|
+
let s = [...n];
|
|
24
|
+
for (let e of o) s[e.i] = e.y;
|
|
25
|
+
return s;
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { n as relax };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region src/charts/control.tsx
|
|
4
|
+
var t = (e) => e === !0 ? "border-ink bg-ink text-paper" : "border-rule bg-paper text-text group-hover:border-faint", n = (n) => /* @__PURE__ */ e("button", {
|
|
5
|
+
type: "button",
|
|
6
|
+
"aria-label": n.label,
|
|
7
|
+
"aria-pressed": n.pressed,
|
|
8
|
+
onClick: () => {
|
|
9
|
+
n.onClick();
|
|
10
|
+
},
|
|
11
|
+
className: `group inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center border-0 bg-transparent p-0 focus-visible:outline-none ${n.className ?? ""}`,
|
|
12
|
+
children: /* @__PURE__ */ e("span", {
|
|
13
|
+
className: `group-focus-visible:outline-muted text-tick inline-flex h-7 items-center gap-1.5 rounded-full border px-3 font-medium transition-colors group-focus-visible:outline-1 group-focus-visible:outline-offset-2 ${t(n.pressed)}`,
|
|
14
|
+
children: n.children
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as Control };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEntry as e, useMeasure as t, useReveal as n } from "./hooks.js";
|
|
3
|
+
import { PANEL as r } from "./roles.js";
|
|
4
|
+
import { ScaleContext as i } from "./scale-context.js";
|
|
5
|
+
import { useContext as a, useLayoutEffect as o, useRef as s, useState as c } from "react";
|
|
6
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
//#region src/charts/core.tsx
|
|
8
|
+
var d = (e) => e ? "is-shown" : "is-hidden", f = (e) => e === "still" ? "is-still" : d(e === "shown"), p = (e) => {
|
|
9
|
+
let i = s(null), [a, o] = t(), c = n(i);
|
|
10
|
+
return /* @__PURE__ */ u("figure", {
|
|
11
|
+
ref: i,
|
|
12
|
+
className: `m-0 ${r} ${d(c)} ${e.className ?? ""}`,
|
|
13
|
+
children: [
|
|
14
|
+
e.top,
|
|
15
|
+
/* @__PURE__ */ l("div", {
|
|
16
|
+
ref: a,
|
|
17
|
+
children: o > 0 && e.children(o)
|
|
18
|
+
}),
|
|
19
|
+
e.bottom
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
}, m = {}, h = (n) => {
|
|
23
|
+
let r = n.width !== void 0, [a, o] = t(n.width ?? n.initialWidth ?? 0, !r), s = n.width ?? o, c = e(a, {
|
|
24
|
+
...n,
|
|
25
|
+
animate: n.animate ?? (r ? "off" : "scroll")
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ u("div", {
|
|
28
|
+
ref: a,
|
|
29
|
+
"data-hl-ready": c.ready ? "true" : "false",
|
|
30
|
+
className: `[&_svg:focus-visible]:outline-muted relative min-w-0 [&_svg]:block [&_svg]:select-none [&_svg:focus]:outline-none [&_svg:focus-visible]:outline-1 [&_svg:focus-visible]:outline-offset-4 [&_svg:focus-visible]:outline-solid ${f(c.phase)} ${n.className ?? ""}`,
|
|
31
|
+
style: n.style,
|
|
32
|
+
children: [/* @__PURE__ */ u(i.Provider, {
|
|
33
|
+
value: n.scaling ?? m,
|
|
34
|
+
children: [s > 0 && n.children(s), n.overlay]
|
|
35
|
+
}), n.table]
|
|
36
|
+
});
|
|
37
|
+
}, g = 4, _ = ({ fit: e, scale: t }) => e === !0 ? 1 : t ?? 1, v = (e) => {
|
|
38
|
+
let t = _(a(i)), n = e.x * t, r = e.y * t, u = s(null), [d, f] = c(0);
|
|
39
|
+
return o(() => {
|
|
40
|
+
let e = u.current, t = e?.offsetParent;
|
|
41
|
+
if (e === null || !(t instanceof HTMLElement)) return;
|
|
42
|
+
let r = e.offsetWidth / 2, i = t.querySelector("svg")?.getBoundingClientRect().width ?? 0, a = Math.min(Math.max(n, r + g), Math.max(t.clientWidth, i) - r - g);
|
|
43
|
+
f(a - n);
|
|
44
|
+
}, [n]), /* @__PURE__ */ l("output", {
|
|
45
|
+
ref: u,
|
|
46
|
+
className: `rounded-tip bg-ink text-paper text-tick/normal pointer-events-none absolute z-10 px-2.5 py-1.75 whitespace-nowrap tabular-nums [&_b]:font-semibold ${e.below === !0 ? "-translate-x-1/2 translate-y-3" : "-mt-2.5 -translate-x-1/2 -translate-y-full"}`,
|
|
47
|
+
style: {
|
|
48
|
+
left: n + d,
|
|
49
|
+
top: r
|
|
50
|
+
},
|
|
51
|
+
children: e.children
|
|
52
|
+
});
|
|
53
|
+
}, y = (e) => /* @__PURE__ */ u("defs", { children: [
|
|
54
|
+
/* @__PURE__ */ l("clipPath", {
|
|
55
|
+
id: `${e.id}-past`,
|
|
56
|
+
children: /* @__PURE__ */ l("rect", {
|
|
57
|
+
x: -40,
|
|
58
|
+
y: -40,
|
|
59
|
+
width: Math.max(0, e.x + 40),
|
|
60
|
+
height: e.height + 80
|
|
61
|
+
})
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ l("clipPath", {
|
|
64
|
+
id: `${e.id}-future`,
|
|
65
|
+
children: /* @__PURE__ */ l("rect", {
|
|
66
|
+
x: e.x,
|
|
67
|
+
y: -40,
|
|
68
|
+
width: e.width + 40,
|
|
69
|
+
height: e.height + 80
|
|
70
|
+
})
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ l("clipPath", {
|
|
73
|
+
id: `${e.id}-sweep`,
|
|
74
|
+
children: /* @__PURE__ */ l("rect", {
|
|
75
|
+
className: "sweep",
|
|
76
|
+
x: -40,
|
|
77
|
+
y: -40,
|
|
78
|
+
width: e.width + 80,
|
|
79
|
+
height: e.height + 80
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
] });
|
|
83
|
+
//#endregion
|
|
84
|
+
export { p as Chart, h as Plot, y as SplitClips, v as Tooltip };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/charts/data-table.tsx
|
|
4
|
+
var n = (e) => {
|
|
5
|
+
let t = /* @__PURE__ */ new Map();
|
|
6
|
+
return e.map((e) => {
|
|
7
|
+
let n = (t.get(e) ?? 0) + 1;
|
|
8
|
+
return t.set(e, n), {
|
|
9
|
+
key: `${e}#${n}`,
|
|
10
|
+
text: e
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
}, r = (r) => {
|
|
14
|
+
let i = n(r.columns), a = n(r.rows.map((e) => e.join(""))), o = /* @__PURE__ */ t("table", {
|
|
15
|
+
className: r.visible === !0 ? "text-small mt-3 w-full border-collapse text-left tabular-nums" : void 0,
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ e("caption", {
|
|
18
|
+
className: r.visible === !0 ? "sr-only" : void 0,
|
|
19
|
+
children: r.caption
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: i.map(({ key: t, text: n }) => /* @__PURE__ */ e("th", {
|
|
22
|
+
scope: "col",
|
|
23
|
+
children: n
|
|
24
|
+
}, t)) }) }),
|
|
25
|
+
/* @__PURE__ */ e("tbody", { children: a.map(({ key: t }, i) => /* @__PURE__ */ e("tr", { children: n(r.rows[i] ?? []).map((t) => /* @__PURE__ */ e("td", { children: t.text }, t.key)) }, t)) })
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
return r.visible === !0 ? o : /* @__PURE__ */ e("div", {
|
|
29
|
+
className: "sr-only",
|
|
30
|
+
children: o
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { r as DataTable };
|