@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,246 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useHover as e } from "../hooks.js";
|
|
3
|
+
import { Plot as t, Tooltip as n } from "../core.js";
|
|
4
|
+
import { noteOf as r, noteSpace as i, sansWidth as a } from "../util.js";
|
|
5
|
+
import { DimGroup as o, HitRect as s, TipText as c } from "../hover.js";
|
|
6
|
+
import { Bar as l, Dot as u, Ring as d } from "../markers.js";
|
|
7
|
+
import { FootNote as f } from "../plot-note.js";
|
|
8
|
+
import { HRule as p } from "../rules.js";
|
|
9
|
+
import { ChartSvg as m } from "../svg.js";
|
|
10
|
+
import { Label as h } from "../text.js";
|
|
11
|
+
import { paint as g, useTextureIds as _ } from "../texture-ids.js";
|
|
12
|
+
import { Hatch as v } from "../texture.js";
|
|
13
|
+
import { labelRoom as y, textWidth as b } from "./util-a.js";
|
|
14
|
+
import { Control as x } from "../control.js";
|
|
15
|
+
import { easeTravel as S } from "../motion.js";
|
|
16
|
+
import { usePlayhead as C } from "../playback.js";
|
|
17
|
+
import { barRaceDemo as w } from "./bar-race.data.js";
|
|
18
|
+
import { ControlSlot as T } from "./control-slot.js";
|
|
19
|
+
import { useRef as E } from "react";
|
|
20
|
+
import { scaleLinear as D } from "d3-scale";
|
|
21
|
+
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
22
|
+
//#region src/charts/glance/bar-race.tsx
|
|
23
|
+
var A = (e) => `${Math.round(e)}m`, j = (e, t, n) => {
|
|
24
|
+
let r = /* @__PURE__ */ new Map(), i = "";
|
|
25
|
+
for (let a of t) {
|
|
26
|
+
let [t, o = ""] = e[a].split(" ");
|
|
27
|
+
r.set(a, o !== i || a === n ? e[a] : t), i = o;
|
|
28
|
+
}
|
|
29
|
+
return r;
|
|
30
|
+
}, M = (e, t) => {
|
|
31
|
+
let n = e.periods.length - 1, r = Math.max(0, Math.min(n, Math.floor(t))), i = Math.min(n, r + 1), a = S(Math.max(0, Math.min(1, t - r)));
|
|
32
|
+
return e.series.map((e) => e.values[r] + (e.values[i] - e.values[r]) * a);
|
|
33
|
+
}, N = 900, P = (e, t, n) => C({
|
|
34
|
+
box: e,
|
|
35
|
+
end: t,
|
|
36
|
+
rate: n,
|
|
37
|
+
reduced: "step",
|
|
38
|
+
start: t,
|
|
39
|
+
step: {
|
|
40
|
+
every: N,
|
|
41
|
+
unit: 1
|
|
42
|
+
}
|
|
43
|
+
}), F = 8, I = (e, t, n) => {
|
|
44
|
+
let r = e.length - 1, i = (t) => {
|
|
45
|
+
let i = a(e[t], 11), o = t === r ? n(t) + 4 - i : n(t) - i / 2;
|
|
46
|
+
return {
|
|
47
|
+
left: o,
|
|
48
|
+
right: o + i
|
|
49
|
+
};
|
|
50
|
+
}, o = i(t);
|
|
51
|
+
return [...e.flatMap((t, n) => n === 0 || e[n - 1].split(" ")[1] !== t.split(" ")[1] ? [n] : []).filter((e) => {
|
|
52
|
+
let n = i(e);
|
|
53
|
+
return e !== t && (n.right + F < o.left || n.left > o.right + F);
|
|
54
|
+
}), t].toSorted((e, t) => e - t);
|
|
55
|
+
}, L = (e) => {
|
|
56
|
+
let t = e.periods.length - 1, n = D().domain([0, t]).range([e.left, e.width - Math.max(4, a(e.periods[t] ?? "") / 2)]), r = e.periods.indexOf(e.current), i = e.narrow ? new Map(I(e.periods, r, n).map((t) => [t, e.periods[t]])) : j(e.periods, e.periods.map((e, t) => t), r);
|
|
57
|
+
return /* @__PURE__ */ k("g", { children: [
|
|
58
|
+
/* @__PURE__ */ O(p, {
|
|
59
|
+
kind: "rule",
|
|
60
|
+
x0: n(0),
|
|
61
|
+
x1: n(t),
|
|
62
|
+
y: e.y
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ O("line", {
|
|
65
|
+
className: "stroke-ink",
|
|
66
|
+
x1: n(0),
|
|
67
|
+
x2: n(e.t),
|
|
68
|
+
y1: Math.round(e.y),
|
|
69
|
+
y2: Math.round(e.y),
|
|
70
|
+
strokeWidth: 2
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ O(s, {
|
|
73
|
+
className: "cursor-pointer",
|
|
74
|
+
x: n(0) - 22,
|
|
75
|
+
y: e.y - 30,
|
|
76
|
+
width: n(t) - n(0) + 44,
|
|
77
|
+
height: 44,
|
|
78
|
+
onClick: (r) => {
|
|
79
|
+
let i = r.currentTarget.getBoundingClientRect(), a = n(0) - 22 + (r.clientX - i.left) / i.width * (n(t) - n(0) + 44);
|
|
80
|
+
e.onSeek(Math.max(0, Math.min(t, Math.round(n.invert(a)))));
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
e.periods.map((t, r) => {
|
|
84
|
+
let a = r <= e.t, o = i.get(r);
|
|
85
|
+
return /* @__PURE__ */ k("g", {
|
|
86
|
+
className: "pointer-events-none",
|
|
87
|
+
children: [a ? /* @__PURE__ */ O(u, {
|
|
88
|
+
className: "fill-hero",
|
|
89
|
+
cx: n(r),
|
|
90
|
+
cy: e.y,
|
|
91
|
+
size: "sm"
|
|
92
|
+
}) : /* @__PURE__ */ O(d, {
|
|
93
|
+
className: "stroke-l5",
|
|
94
|
+
cx: n(r),
|
|
95
|
+
cy: e.y,
|
|
96
|
+
size: "sm"
|
|
97
|
+
}), o === void 0 ? null : /* @__PURE__ */ O(h, {
|
|
98
|
+
anchor: "middle",
|
|
99
|
+
voice: t === e.current ? "value" : "axis",
|
|
100
|
+
x: n(r),
|
|
101
|
+
y: e.y - 10,
|
|
102
|
+
children: o
|
|
103
|
+
})]
|
|
104
|
+
}, t);
|
|
105
|
+
})
|
|
106
|
+
] });
|
|
107
|
+
}, R = (e) => /* @__PURE__ */ k(o, {
|
|
108
|
+
className: e.jump ? void 0 : "ease-travel duration-change transition-transform",
|
|
109
|
+
dim: e.dimmed,
|
|
110
|
+
style: { transform: `translateY(${Math.round(e.y)}px)` },
|
|
111
|
+
onPointerEnter: () => {
|
|
112
|
+
e.onEnter(e.labelX + e.w / 2, e.y - e.barH / 2 - 4);
|
|
113
|
+
},
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ O(s, {
|
|
116
|
+
x: 0,
|
|
117
|
+
y: -e.pitch / 2,
|
|
118
|
+
width: e.width,
|
|
119
|
+
height: e.pitch
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ O(h, {
|
|
122
|
+
anchor: "end",
|
|
123
|
+
dy: "0.35em",
|
|
124
|
+
muted: !e.leader,
|
|
125
|
+
voice: "label",
|
|
126
|
+
x: e.labelX - 10,
|
|
127
|
+
y: 0,
|
|
128
|
+
children: e.series.label
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ O(l, {
|
|
131
|
+
className: e.fill,
|
|
132
|
+
dir: "right",
|
|
133
|
+
fill: e.fill === void 0 ? g(e.hatch) : void 0,
|
|
134
|
+
h: e.barH,
|
|
135
|
+
w: e.w,
|
|
136
|
+
x: e.labelX,
|
|
137
|
+
y: -e.barH / 2
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ O(h, {
|
|
140
|
+
dy: "0.36em",
|
|
141
|
+
muted: !e.leader,
|
|
142
|
+
voice: "value",
|
|
143
|
+
x: e.labelX + e.w + 8,
|
|
144
|
+
y: 0,
|
|
145
|
+
children: e.value
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
}), z = (e) => e.done ? /* @__PURE__ */ O("path", {
|
|
149
|
+
d: "M7.5 3.2A3.6 3.6 0 1 0 8 6",
|
|
150
|
+
className: "fill-none stroke-current",
|
|
151
|
+
strokeWidth: 1.5,
|
|
152
|
+
strokeLinecap: "round"
|
|
153
|
+
}) : e.playing ? /* @__PURE__ */ O("path", {
|
|
154
|
+
d: "M1 1h2.4v8H1zM5.6 1H8v8H5.6z",
|
|
155
|
+
className: "fill-current"
|
|
156
|
+
}) : /* @__PURE__ */ O("path", {
|
|
157
|
+
d: "M1 0.8 8.4 5 1 9.2z",
|
|
158
|
+
className: "fill-current"
|
|
159
|
+
}), B = (e, t) => e ? "Replay" : t ? "Pause" : "Play", V = (e, t) => ({
|
|
160
|
+
bottom: 44,
|
|
161
|
+
left: Math.max(y(e.series.map((e) => e.label), "t-label") + 10, Math.ceil(b(e.periods[0], "t-axis") / 2)),
|
|
162
|
+
right: 8 + y(e.series.flatMap((e) => e.values.map((e) => t(e))), "t-value"),
|
|
163
|
+
top: 4
|
|
164
|
+
}), H = (a) => {
|
|
165
|
+
let o = a.data ?? w, s = (a.height ?? 460) - 44, l = a.format ?? A, u = o.periods.length - 1, d = E(null), p = _("race")("hatch"), h = P(d, u, a.speed ?? 1500), g = e(), y = M(o, h.t), b = y.map((e, t) => ({
|
|
166
|
+
i: t,
|
|
167
|
+
v: e
|
|
168
|
+
})).toSorted((e, t) => t.v - e.v), S = Array.from({ length: y.length }, () => 0);
|
|
169
|
+
for (let [e, t] of b.entries()) S[t.i] = e;
|
|
170
|
+
let C = o.periods[Math.min(u, Math.round(h.t))], j = `Bar race, ${o.periods[0]} to ${o.periods[u]}. ${C}: ${b.map((e) => `${o.series[e.i].label} ${l(e.v)}`).join(", ")}`, N = B(h.done, h.playing);
|
|
171
|
+
return /* @__PURE__ */ k("div", {
|
|
172
|
+
ref: d,
|
|
173
|
+
className: "relative",
|
|
174
|
+
children: [/* @__PURE__ */ O(T, { children: /* @__PURE__ */ k(x, {
|
|
175
|
+
onClick: h.handleToggle,
|
|
176
|
+
label: `${N} the race`,
|
|
177
|
+
children: [/* @__PURE__ */ O("svg", {
|
|
178
|
+
width: 9,
|
|
179
|
+
height: 10,
|
|
180
|
+
viewBox: "0 0 9 10",
|
|
181
|
+
"aria-hidden": !0,
|
|
182
|
+
children: /* @__PURE__ */ O(z, {
|
|
183
|
+
done: h.done,
|
|
184
|
+
playing: h.playing
|
|
185
|
+
})
|
|
186
|
+
}), N]
|
|
187
|
+
}) }), /* @__PURE__ */ O(t, {
|
|
188
|
+
overlay: g.at === null ? null : /* @__PURE__ */ O(n, {
|
|
189
|
+
x: g.at.x,
|
|
190
|
+
y: g.at.y,
|
|
191
|
+
children: /* @__PURE__ */ O(c, {
|
|
192
|
+
facts: [l(y[g.at.key]), `#${S[g.at.key] + 1} in ${C}`],
|
|
193
|
+
lead: o.series[g.at.key].label
|
|
194
|
+
})
|
|
195
|
+
}),
|
|
196
|
+
children: (e) => {
|
|
197
|
+
let t = V(o, l), n = (s - t.top - t.bottom) / o.series.length, c = D().domain([0, Math.max(1, b[0]?.v ?? 1)]).range([0, e - t.left - t.right]), u = s + i(r(a), e - 16, 22);
|
|
198
|
+
return /* @__PURE__ */ k(m, {
|
|
199
|
+
height: u,
|
|
200
|
+
label: j,
|
|
201
|
+
leave: g.clear,
|
|
202
|
+
width: e,
|
|
203
|
+
children: [
|
|
204
|
+
/* @__PURE__ */ O("defs", { children: /* @__PURE__ */ O(v, {
|
|
205
|
+
id: p,
|
|
206
|
+
tone: "fill-l4"
|
|
207
|
+
}) }),
|
|
208
|
+
o.series.map((r, i) => /* @__PURE__ */ O(R, {
|
|
209
|
+
barH: Math.min(36, n * .68),
|
|
210
|
+
jump: h.reduced,
|
|
211
|
+
dimmed: g.dim(i),
|
|
212
|
+
fill: a.highlight === r.label || S[i] === 0 ? "fill-hero" : void 0,
|
|
213
|
+
hatch: p,
|
|
214
|
+
labelX: t.left,
|
|
215
|
+
leader: S[i] === 0,
|
|
216
|
+
onEnter: g.showAt(i),
|
|
217
|
+
pitch: n,
|
|
218
|
+
series: r,
|
|
219
|
+
value: l(y[i]),
|
|
220
|
+
w: c(y[i]),
|
|
221
|
+
width: e,
|
|
222
|
+
y: t.top + n * (S[i] + .5)
|
|
223
|
+
}, r.label)),
|
|
224
|
+
/* @__PURE__ */ O(L, {
|
|
225
|
+
current: C,
|
|
226
|
+
left: t.left,
|
|
227
|
+
narrow: e < 520,
|
|
228
|
+
onSeek: h.handleSeek,
|
|
229
|
+
periods: o.periods,
|
|
230
|
+
t: h.t,
|
|
231
|
+
width: e,
|
|
232
|
+
y: s - 14
|
|
233
|
+
}),
|
|
234
|
+
/* @__PURE__ */ O(f, {
|
|
235
|
+
height: u,
|
|
236
|
+
text: r(a),
|
|
237
|
+
width: e
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
})]
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
//#endregion
|
|
246
|
+
export { H as BarRace };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/charts/glance/big-slice.data.ts
|
|
3
|
+
var e = [
|
|
4
|
+
{
|
|
5
|
+
intensity: 169.8,
|
|
6
|
+
label: "18–24",
|
|
7
|
+
share: 5246523
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
intensity: 156.8,
|
|
11
|
+
label: "25–34",
|
|
12
|
+
share: 8957457
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
intensity: 169.8,
|
|
16
|
+
label: "35–44",
|
|
17
|
+
share: 8996949
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
intensity: 209.5,
|
|
21
|
+
label: "45–54",
|
|
22
|
+
share: 8448639
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
intensity: 242,
|
|
26
|
+
label: "55–64",
|
|
27
|
+
share: 8815721
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
intensity: 317.6,
|
|
31
|
+
label: "65–74",
|
|
32
|
+
share: 8305762
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
intensity: 334.8,
|
|
36
|
+
label: "75+",
|
|
37
|
+
share: 4376563
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
//#endregion
|
|
41
|
+
export { e as bigSliceDemo };
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useHover as e } from "../hooks.js";
|
|
3
|
+
import { Plot as t, Tooltip as n } from "../core.js";
|
|
4
|
+
import { noteOf as r, noteSpace as i, ranks as a, sansWidth as o, stagger as s } from "../util.js";
|
|
5
|
+
import { DimGroup as c, TipText as l } from "../hover.js";
|
|
6
|
+
import { RING_STEP as u } from "../marks.js";
|
|
7
|
+
import { FootNote as d } from "../plot-note.js";
|
|
8
|
+
import { ChartSvg as f } from "../svg.js";
|
|
9
|
+
import { Label as p } from "../text.js";
|
|
10
|
+
import { paint as m, useTextureIds as h } from "../texture-ids.js";
|
|
11
|
+
import { DotRing as g, Hatch as _ } from "../texture.js";
|
|
12
|
+
import { bigSliceDemo as v } from "./big-slice.data.js";
|
|
13
|
+
import { scaleRadial as y } from "d3-scale";
|
|
14
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
15
|
+
import { arc as S, pie as C } from "d3-shape";
|
|
16
|
+
//#region src/charts/glance/big-slice.tsx
|
|
17
|
+
var w = (e) => `${Math.round(e)}%`, T = (e) => {
|
|
18
|
+
let t = Math.round(e);
|
|
19
|
+
return t < 60 ? `${t}m` : `${Math.floor(t / 60)}h ${String(t % 60).padStart(2, "0")}m`;
|
|
20
|
+
}, E = (e) => `${e / 60}h`, D = Math.PI * 2, O = 6, k = 14, A = (e) => Math.min(e % D, D - e % D), j = (e, t) => {
|
|
21
|
+
let n = e.findIndex((e) => !t(e));
|
|
22
|
+
if (n === -1) return null;
|
|
23
|
+
let r = [], i = null;
|
|
24
|
+
for (let a = 1; a <= e.length; a += 1) {
|
|
25
|
+
let o = e[(n + a) % e.length];
|
|
26
|
+
if (t(o)) {
|
|
27
|
+
let e = i === null ? o.startAngle : i.a0, t = o.startAngle < e ? D : 0;
|
|
28
|
+
i = {
|
|
29
|
+
a0: e,
|
|
30
|
+
a1: o.endAngle + t
|
|
31
|
+
};
|
|
32
|
+
} else i !== null && (r.push(i), i = null);
|
|
33
|
+
}
|
|
34
|
+
return r;
|
|
35
|
+
}, M = (e) => {
|
|
36
|
+
let t = e.map((e) => (e.startAngle + e.endAngle) / 2);
|
|
37
|
+
return (Math.max(...t) + (Math.min(...t) + D)) / 2;
|
|
38
|
+
}, N = (e, t, n, r) => {
|
|
39
|
+
let i = t(n), a = j(e, (e) => t(e.data.intensity) < i - 7);
|
|
40
|
+
if (a === null) return M(e);
|
|
41
|
+
let o = (r / 2 + 8) / i, s = null;
|
|
42
|
+
for (let e of a) {
|
|
43
|
+
let t = e.a0 + o, n = e.a1 - o;
|
|
44
|
+
if (t > n) continue;
|
|
45
|
+
let r = t <= D && D <= n ? 0 : [t, n].toSorted((e, t) => A(e) - A(t))[0];
|
|
46
|
+
(s === null || A(r) < A(s)) && (s = r);
|
|
47
|
+
}
|
|
48
|
+
return s;
|
|
49
|
+
}, P = (e, t) => {
|
|
50
|
+
let n = [Math.sin(e), Math.sin(t)];
|
|
51
|
+
return {
|
|
52
|
+
max: e <= Math.PI / 2 && t >= Math.PI / 2 ? 1 : Math.max(...n),
|
|
53
|
+
min: e <= 1.5 * Math.PI && t >= 1.5 * Math.PI ? -1 : Math.min(...n)
|
|
54
|
+
};
|
|
55
|
+
}, F = (e, t) => {
|
|
56
|
+
let n = y().domain([0, e.max]).range([t * .24, t]), r = n(e.ring), i = 0, a = 0;
|
|
57
|
+
for (let [t, s] of e.slices.entries()) {
|
|
58
|
+
let c = n(s.data.intensity), l = P(s.startAngle, s.endAngle);
|
|
59
|
+
i = Math.max(i, -l.min * c), a = Math.max(a, l.max * c);
|
|
60
|
+
let { figures: u, name: d } = e.labels[t], f = o(d, 11) + O + o(u, 11), p = Math.sin((s.startAngle + s.endAngle) / 2) * (Math.max(c, r) + k);
|
|
61
|
+
p >= 0 ? a = Math.max(a, p + f) : i = Math.max(i, -p + f);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
left: i,
|
|
65
|
+
right: a
|
|
66
|
+
};
|
|
67
|
+
}, I = (e) => {
|
|
68
|
+
let t = Math.max(60, Math.min((e.height - e.bottom - 56) / 2, (e.width - (e.narrow ? 68 : 300)) / 2)), n = (t) => {
|
|
69
|
+
let { left: n, right: r } = F(e, t);
|
|
70
|
+
return n + r + 4 <= e.width;
|
|
71
|
+
}, r = 60, i = t;
|
|
72
|
+
if (!n(i)) {
|
|
73
|
+
for (let e = 0; e < 20; e += 1) {
|
|
74
|
+
let e = (r + i) / 2;
|
|
75
|
+
n(e) ? r = e : i = e;
|
|
76
|
+
}
|
|
77
|
+
i = r;
|
|
78
|
+
}
|
|
79
|
+
let { left: a, right: o } = F(e, i);
|
|
80
|
+
return {
|
|
81
|
+
cx: (e.width - a - o) / 2 + a,
|
|
82
|
+
outer: i
|
|
83
|
+
};
|
|
84
|
+
}, L = (e) => {
|
|
85
|
+
let t = e * 180 / Math.PI;
|
|
86
|
+
return t > 90 && t < 270 ? t - 180 : t;
|
|
87
|
+
}, R = (e) => e.angle === null ? /* @__PURE__ */ b(p, {
|
|
88
|
+
anchor: "end",
|
|
89
|
+
dy: "0.7em",
|
|
90
|
+
halo: !0,
|
|
91
|
+
voice: "axis",
|
|
92
|
+
x: -5,
|
|
93
|
+
y: -e.radius + 3,
|
|
94
|
+
children: e.text
|
|
95
|
+
}) : /* @__PURE__ */ b(p, {
|
|
96
|
+
anchor: "middle",
|
|
97
|
+
dy: "0.35em",
|
|
98
|
+
halo: !0,
|
|
99
|
+
transform: `translate(${Math.sin(e.angle) * e.radius},${-Math.cos(e.angle) * e.radius}) rotate(${L(e.angle)})`,
|
|
100
|
+
voice: "axis",
|
|
101
|
+
children: e.text
|
|
102
|
+
}), z = (e) => {
|
|
103
|
+
let t = e.r(e.d.intensity), n = (e.slice.startAngle + e.slice.endAngle) / 2, r = Math.max(t, e.labelRadius) + k, i = Math.sin(n) * r, a = -Math.cos(n) * r, o = Math.sin(n) >= 0 ? "start" : "end", { cx: l, cy: u } = e.centre;
|
|
104
|
+
return /* @__PURE__ */ x(c, {
|
|
105
|
+
dim: e.dim,
|
|
106
|
+
onPointerEnter: () => {
|
|
107
|
+
e.onEnter(l + Math.sin(n) * t * .7, u - Math.cos(n) * t * .7 - 8);
|
|
108
|
+
},
|
|
109
|
+
children: [/* @__PURE__ */ b("path", {
|
|
110
|
+
className: `pop ${e.fill}`,
|
|
111
|
+
fill: e.pattern,
|
|
112
|
+
strokeWidth: e.pattern === void 0 ? void 0 : 1,
|
|
113
|
+
style: {
|
|
114
|
+
...s(e.i, "series"),
|
|
115
|
+
transformBox: "view-box",
|
|
116
|
+
transformOrigin: `${l}px ${u}px`
|
|
117
|
+
},
|
|
118
|
+
d: e.wedge({
|
|
119
|
+
endAngle: e.slice.endAngle,
|
|
120
|
+
outer: t,
|
|
121
|
+
padAngle: e.slice.padAngle,
|
|
122
|
+
startAngle: e.slice.startAngle
|
|
123
|
+
}) ?? ""
|
|
124
|
+
}), /* @__PURE__ */ x("text", {
|
|
125
|
+
className: "fade fill-text",
|
|
126
|
+
style: s(e.i + 3),
|
|
127
|
+
x: i,
|
|
128
|
+
y: a,
|
|
129
|
+
dy: "0.35em",
|
|
130
|
+
textAnchor: o,
|
|
131
|
+
children: [/* @__PURE__ */ b("tspan", {
|
|
132
|
+
className: "t-label",
|
|
133
|
+
children: e.d.label
|
|
134
|
+
}), /* @__PURE__ */ b("tspan", {
|
|
135
|
+
className: "t-axis",
|
|
136
|
+
dx: O,
|
|
137
|
+
children: e.narrow ? e.shareText : `${e.shareText} · ${e.valueText}`
|
|
138
|
+
})]
|
|
139
|
+
})]
|
|
140
|
+
});
|
|
141
|
+
}, B = (e, t, n, r) => e.map((e) => {
|
|
142
|
+
let i = o(r(e), 11);
|
|
143
|
+
return {
|
|
144
|
+
angle: N(t, n, e, i),
|
|
145
|
+
half: (i / 2 + 5) / n(e),
|
|
146
|
+
radius: n(e)
|
|
147
|
+
};
|
|
148
|
+
}), V = (e) => /* @__PURE__ */ b("g", { children: e.rings.map((e) => e.angle === null ? /* @__PURE__ */ b(g, {
|
|
149
|
+
cx: 0,
|
|
150
|
+
cy: 0,
|
|
151
|
+
r: e.radius,
|
|
152
|
+
step: u.guide,
|
|
153
|
+
tone: "fill-l5"
|
|
154
|
+
}, e.radius) : /* @__PURE__ */ b(g, {
|
|
155
|
+
cx: 0,
|
|
156
|
+
cy: 0,
|
|
157
|
+
from: e.angle + e.half,
|
|
158
|
+
r: e.radius,
|
|
159
|
+
step: u.guide,
|
|
160
|
+
to: e.angle - e.half + D,
|
|
161
|
+
tone: "fill-l5"
|
|
162
|
+
}, e.radius)) }), H = (o) => {
|
|
163
|
+
let s = o.data ?? v, c = o.height ?? 400, u = o.rings ?? [240, 360], p = o.formatShare ?? w, g = o.format ?? T, D = o.ringFormat ?? E, O = e(), k = a(s.map((e) => e.intensity)), A = o.highlight ?? k.indexOf(0), j = h("slice"), M = s.reduce((e, t) => e + t.share, 0), N = (e) => p(e.share / M * 100), P = `Pie: ${s.map((e) => `${e.label} ${N(e)}, ${g(e.intensity)}`).join("; ")}`, F = o.intensityLabel === void 0 ? "" : ` ${o.intensityLabel}`;
|
|
164
|
+
return /* @__PURE__ */ b(t, {
|
|
165
|
+
overlay: O.at === null ? null : /* @__PURE__ */ b(n, {
|
|
166
|
+
x: O.at.x,
|
|
167
|
+
y: O.at.y,
|
|
168
|
+
children: /* @__PURE__ */ b(l, {
|
|
169
|
+
facts: [`${N(s[O.at.key])} of adults`, `${g(s[O.at.key].intensity)}${F}`],
|
|
170
|
+
lead: s[O.at.key].label
|
|
171
|
+
})
|
|
172
|
+
}),
|
|
173
|
+
children: (e) => {
|
|
174
|
+
let t = e < 520, n = (e) => ({
|
|
175
|
+
figures: t ? N(e) : `${N(e)} · ${g(e.intensity)}`,
|
|
176
|
+
name: e.label
|
|
177
|
+
}), a = 8 + i(r(o), e - 16, 18), l = C().value((e) => e.share).sortValues(null).padAngle(.035)(s), p = Math.max(...s.map((e) => e.intensity), ...u), { cx: h, outer: v } = I({
|
|
178
|
+
bottom: a,
|
|
179
|
+
height: c,
|
|
180
|
+
labels: l.map((e) => n(e.data)),
|
|
181
|
+
max: p,
|
|
182
|
+
narrow: t,
|
|
183
|
+
ring: u.at(-1) ?? p,
|
|
184
|
+
slices: l,
|
|
185
|
+
width: e
|
|
186
|
+
}), w = v * .24, T = {
|
|
187
|
+
cx: h,
|
|
188
|
+
cy: 28 + v
|
|
189
|
+
}, E = Math.min(c, Math.round(T.cy + v + 34 + a)), k = y().domain([0, p]).range([w, v]), M = B(u, l, k, D), F = S().innerRadius(w).outerRadius((e) => e.outer).cornerRadius(4).padRadius(v);
|
|
190
|
+
return /* @__PURE__ */ x(f, {
|
|
191
|
+
height: E,
|
|
192
|
+
label: P,
|
|
193
|
+
leave: O.clear,
|
|
194
|
+
width: e,
|
|
195
|
+
children: [
|
|
196
|
+
/* @__PURE__ */ b("defs", { children: /* @__PURE__ */ b(_, {
|
|
197
|
+
id: j("hatch"),
|
|
198
|
+
tone: "fill-l4"
|
|
199
|
+
}) }),
|
|
200
|
+
/* @__PURE__ */ x("g", {
|
|
201
|
+
transform: `translate(${T.cx},${T.cy})`,
|
|
202
|
+
children: [
|
|
203
|
+
/* @__PURE__ */ b(V, { rings: M }),
|
|
204
|
+
l.map((e, n) => /* @__PURE__ */ b(z, {
|
|
205
|
+
centre: T,
|
|
206
|
+
d: e.data,
|
|
207
|
+
dim: O.dim(n),
|
|
208
|
+
fill: A === n ? "fill-hero" : "stroke-l5",
|
|
209
|
+
pattern: A === n ? void 0 : m(j("hatch")),
|
|
210
|
+
i: n,
|
|
211
|
+
labelRadius: k(u.at(-1) ?? p),
|
|
212
|
+
narrow: t,
|
|
213
|
+
onEnter: O.showAt(n),
|
|
214
|
+
r: k,
|
|
215
|
+
shareText: N(e.data),
|
|
216
|
+
slice: e,
|
|
217
|
+
valueText: g(e.data.intensity),
|
|
218
|
+
wedge: F
|
|
219
|
+
}, e.data.label)),
|
|
220
|
+
M.map((e, t) => /* @__PURE__ */ b(R, {
|
|
221
|
+
angle: e.angle,
|
|
222
|
+
radius: e.radius,
|
|
223
|
+
text: D(u[t])
|
|
224
|
+
}, e.radius))
|
|
225
|
+
]
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ b(d, {
|
|
228
|
+
height: E,
|
|
229
|
+
text: r(o),
|
|
230
|
+
width: e
|
|
231
|
+
})
|
|
232
|
+
]
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
//#endregion
|
|
238
|
+
export { H as BigSlice };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/charts/glance/chunky-bars.data.ts
|
|
3
|
+
var e = [
|
|
4
|
+
{
|
|
5
|
+
label: "1994",
|
|
6
|
+
value: 158
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
label: "2004",
|
|
10
|
+
value: 233
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
label: "2014",
|
|
14
|
+
value: 337
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: "2024",
|
|
18
|
+
value: 477
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
//#endregion
|
|
22
|
+
export { e as chunkyBarsDemo };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useHover as e } from "../hooks.js";
|
|
3
|
+
import { Plot as t, Tooltip as n } from "../core.js";
|
|
4
|
+
import { noteOf as r, noteSpace as i, stagger as a } from "../util.js";
|
|
5
|
+
import { DimGroup as o, HitRect as s, TipText as c } from "../hover.js";
|
|
6
|
+
import { Bar as l } from "../markers.js";
|
|
7
|
+
import { FootNote as u } from "../plot-note.js";
|
|
8
|
+
import { HRule as d } from "../rules.js";
|
|
9
|
+
import { ChartSvg as f } from "../svg.js";
|
|
10
|
+
import { Label as p } from "../text.js";
|
|
11
|
+
import { paint as m, useTextureIds as h } from "../texture-ids.js";
|
|
12
|
+
import { Hatch as g } from "../texture.js";
|
|
13
|
+
import { rankTones as _ } from "./util-a.js";
|
|
14
|
+
import { chunkyBarsDemo as v } from "./chunky-bars.data.js";
|
|
15
|
+
import { scaleBand as y, scaleLinear as b } from "d3-scale";
|
|
16
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
17
|
+
//#region src/charts/glance/chunky-bars.tsx
|
|
18
|
+
var C = (e) => /* @__PURE__ */ x(l, {
|
|
19
|
+
className: e.hero ? "grow-y fill-hero" : "grow-y",
|
|
20
|
+
dir: "up",
|
|
21
|
+
fill: e.hero ? void 0 : m(e.hatch),
|
|
22
|
+
h: e.floor - e.top,
|
|
23
|
+
style: a(e.i, "series"),
|
|
24
|
+
w: e.bw,
|
|
25
|
+
x: e.cx - e.bw / 2,
|
|
26
|
+
y: e.top
|
|
27
|
+
}), w = (e) => `£${(e / 100).toFixed(2)}`, T = (a) => {
|
|
28
|
+
let l = a.data ?? v, m = a.height ?? 400, T = a.format ?? w, E = e(), D = h("bars")("hatch"), O = _(l.map((e) => e.value), [0, 4]), k = l.map((e) => `${e.label} ${T(e.value)}`).join(", ");
|
|
29
|
+
return /* @__PURE__ */ x(t, {
|
|
30
|
+
overlay: E.at === null ? null : /* @__PURE__ */ x(n, {
|
|
31
|
+
x: E.at.x,
|
|
32
|
+
y: E.at.y,
|
|
33
|
+
children: /* @__PURE__ */ x(c, {
|
|
34
|
+
facts: [T(l[E.at.key].value)],
|
|
35
|
+
lead: l[E.at.key].label
|
|
36
|
+
})
|
|
37
|
+
}),
|
|
38
|
+
children: (e) => {
|
|
39
|
+
let t = e < 460, n = {
|
|
40
|
+
bottom: 34 + i(r(a), e - 16, 18),
|
|
41
|
+
left: 8,
|
|
42
|
+
right: 8,
|
|
43
|
+
top: 40
|
|
44
|
+
}, c = y().domain(l.map((e, t) => t)).range([n.left, e - n.right]).paddingInner(t ? .38 : .58).paddingOuter(.25), h = Math.min(c.bandwidth(), 96), _ = m - n.bottom, v = b().domain([0, Math.max(...l.map((e) => e.value))]).range([_, n.top]);
|
|
45
|
+
return /* @__PURE__ */ S(f, {
|
|
46
|
+
height: m,
|
|
47
|
+
label: k,
|
|
48
|
+
leave: E.clear,
|
|
49
|
+
width: e,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ x("defs", { children: /* @__PURE__ */ x(g, {
|
|
52
|
+
id: D,
|
|
53
|
+
tone: "fill-l4"
|
|
54
|
+
}) }),
|
|
55
|
+
l.map((e, t) => {
|
|
56
|
+
let r = (c(t) ?? 0) + c.bandwidth() / 2, i = v(e.value);
|
|
57
|
+
return /* @__PURE__ */ S(o, {
|
|
58
|
+
dim: E.dim(t),
|
|
59
|
+
onPointerEnter: E.enter(t, r, i - 34),
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ x(s, {
|
|
62
|
+
height: _ - n.top + 60,
|
|
63
|
+
width: h + 16,
|
|
64
|
+
x: r - h / 2 - 8,
|
|
65
|
+
y: n.top - 36
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ x(C, {
|
|
68
|
+
bw: h,
|
|
69
|
+
cx: r,
|
|
70
|
+
floor: _,
|
|
71
|
+
hatch: D,
|
|
72
|
+
hero: O[t] === 0 || a.highlight === t,
|
|
73
|
+
i: t,
|
|
74
|
+
top: i
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ x(p, {
|
|
77
|
+
anchor: "middle",
|
|
78
|
+
muted: O[t] !== 0,
|
|
79
|
+
order: t + 3,
|
|
80
|
+
tier: "series",
|
|
81
|
+
voice: "value",
|
|
82
|
+
x: r,
|
|
83
|
+
y: i - 10,
|
|
84
|
+
children: T(e.value)
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ x(p, {
|
|
87
|
+
anchor: "middle",
|
|
88
|
+
muted: !0,
|
|
89
|
+
voice: "label",
|
|
90
|
+
x: r,
|
|
91
|
+
y: _ + 20,
|
|
92
|
+
children: e.label
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
}, e.label);
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ x(d, {
|
|
98
|
+
x0: n.left,
|
|
99
|
+
x1: e - n.right,
|
|
100
|
+
y: _
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ x(u, {
|
|
103
|
+
height: m,
|
|
104
|
+
text: r(a),
|
|
105
|
+
width: e
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
export { T as ChunkyBars };
|