@howells/hairline 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +148 -2
- package/lib/charts/axes.js +5 -0
- package/lib/charts/basics/candlestick.data.js +44 -0
- package/lib/charts/basics/candlestick.js +180 -0
- package/lib/charts/basics/daily-empty.js +24 -0
- package/lib/charts/basics/daily-readings.js +16 -0
- package/lib/charts/basics/dot-heat.data.js +225 -0
- package/lib/charts/basics/dot-heat.js +174 -0
- package/lib/charts/basics/dumbbell-queue.js +203 -0
- package/lib/charts/basics/hairline-area.js +208 -0
- package/lib/charts/basics/hairline-line.js +195 -0
- package/lib/charts/basics/nested-treemap.data.js +55 -0
- package/lib/charts/basics/nested-treemap.js +191 -0
- package/lib/charts/basics/paired-rungs.data.js +31 -0
- package/lib/charts/basics/paired-rungs.js +151 -0
- package/lib/charts/basics/plumb-scatter.js +229 -0
- package/lib/charts/basics/rung-bars.js +178 -0
- package/lib/charts/basics/rung-geometry.js +6 -0
- package/lib/charts/basics/rung-histogram.data.js +73 -0
- package/lib/charts/basics/rung-histogram.js +153 -0
- package/lib/charts/basics/rung-waterfall.data.js +30 -0
- package/lib/charts/basics/rung-waterfall.js +150 -0
- package/lib/charts/basics/rungs.js +22 -0
- package/lib/charts/basics/series-key.js +26 -0
- package/lib/charts/basics/stacked-rungs.data.js +42 -0
- package/lib/charts/basics/stacked-rungs.js +174 -0
- package/lib/charts/basics/stream-ribbon.data.js +124 -0
- package/lib/charts/basics/stream-ribbon.js +336 -0
- package/lib/charts/basics/tick-box.data.js +50 -0
- package/lib/charts/basics/tick-box.js +226 -0
- package/lib/charts/basics/tick-donut.data.js +30 -0
- package/lib/charts/basics/tick-donut.js +210 -0
- package/lib/charts/basics/tick-gauge.data.js +8 -0
- package/lib/charts/basics/tick-gauge.js +169 -0
- package/lib/charts/basics/tick-rows.data.js +30 -0
- package/lib/charts/basics/tick-rows.js +121 -0
- package/lib/charts/basics/util-a.js +15 -0
- package/lib/charts/basics/util-b.js +13 -0
- package/lib/charts/big/circular-graph.data.js +827 -0
- package/lib/charts/big/circular-graph.js +289 -0
- package/lib/charts/big/force-galaxy-model.js +167 -0
- package/lib/charts/big/force-galaxy.data.js +813 -0
- package/lib/charts/big/force-galaxy.js +276 -0
- package/lib/charts/big/thread-triptych.data.js +204 -0
- package/lib/charts/big/thread-triptych.js +334 -0
- package/lib/charts/board/room.js +6 -0
- package/lib/charts/board/slope.js +176 -0
- package/lib/charts/board/spread.js +28 -0
- package/lib/charts/control.js +18 -0
- package/lib/charts/core.js +84 -0
- package/lib/charts/data-table.js +34 -0
- package/lib/charts/fills.js +153 -0
- package/lib/charts/forms/area-difference.data.js +62 -0
- package/lib/charts/forms/area-difference.js +192 -0
- package/lib/charts/forms/brush-math.js +42 -0
- package/lib/charts/forms/brush-strip.js +199 -0
- package/lib/charts/forms/brushed-overview.data.js +374 -0
- package/lib/charts/forms/brushed-overview.js +162 -0
- package/lib/charts/forms/chord-ring.data.js +140 -0
- package/lib/charts/forms/chord-ring.js +167 -0
- package/lib/charts/forms/circle-pack.data.js +80 -0
- package/lib/charts/forms/circle-pack.js +99 -0
- package/lib/charts/forms/hatched-stack.data.js +71 -0
- package/lib/charts/forms/hatched-stack.js +228 -0
- package/lib/charts/forms/radial-year.data.js +13 -0
- package/lib/charts/forms/radial-year.js +156 -0
- package/lib/charts/frame.js +73 -0
- package/lib/charts/glance/aggregate-sankey.data.js +74 -0
- package/lib/charts/glance/aggregate-sankey.js +242 -0
- package/lib/charts/glance/bar-race.data.js +122 -0
- package/lib/charts/glance/bar-race.js +246 -0
- package/lib/charts/glance/big-slice.data.js +41 -0
- package/lib/charts/glance/big-slice.js +238 -0
- package/lib/charts/glance/chunky-bars.data.js +22 -0
- package/lib/charts/glance/chunky-bars.js +113 -0
- package/lib/charts/glance/circular-graph.data.js +146 -0
- package/lib/charts/glance/circular-graph.js +138 -0
- package/lib/charts/glance/control-slot.js +9 -0
- package/lib/charts/glance/diverging-bar.data.js +34 -0
- package/lib/charts/glance/diverging-bar.js +154 -0
- package/lib/charts/glance/dot-waffle.data.js +26 -0
- package/lib/charts/glance/dot-waffle.js +179 -0
- package/lib/charts/glance/draw-in.data.js +9 -0
- package/lib/charts/glance/draw-in.goals.json.js +289 -0
- package/lib/charts/glance/draw-in.js +214 -0
- package/lib/charts/glance/dynamic-stream.data.js +6 -0
- package/lib/charts/glance/dynamic-stream.js +189 -0
- package/lib/charts/glance/force-graph.data.js +77 -0
- package/lib/charts/glance/force-graph.js +211 -0
- package/lib/charts/glance/jitter-strip.data.js +10 -0
- package/lib/charts/glance/jitter-strip.easter.json.js +430 -0
- package/lib/charts/glance/jitter-strip.js +157 -0
- package/lib/charts/glance/link-bundle.js +51 -0
- package/lib/charts/glance/matrix-heat-glance.data.js +108 -0
- package/lib/charts/glance/matrix-heat-glance.js +170 -0
- package/lib/charts/glance/pictorial-bar.data.js +22 -0
- package/lib/charts/glance/pictorial-bar.js +180 -0
- package/lib/charts/glance/rainfall-dual-area.data.js +177 -0
- package/lib/charts/glance/rainfall-dual-area.js +192 -0
- package/lib/charts/glance/rank-strip.data.js +76 -0
- package/lib/charts/glance/rank-strip.js +172 -0
- package/lib/charts/glance/scatter-labels.js +60 -0
- package/lib/charts/glance/scatter-morph.data.js +78 -0
- package/lib/charts/glance/scatter-morph.js +338 -0
- package/lib/charts/glance/single-axis.data.js +6 -0
- package/lib/charts/glance/single-axis.js +150 -0
- package/lib/charts/glance/single-axis.tides.json.js +180 -0
- package/lib/charts/glance/stagger-wave.data.js +66 -0
- package/lib/charts/glance/stagger-wave.js +132 -0
- package/lib/charts/glance/tree-lr.data.js +41 -0
- package/lib/charts/glance/tree-lr.js +135 -0
- package/lib/charts/glance/util-a.js +49 -0
- package/lib/charts/glance/util-b.js +19 -0
- package/lib/charts/glance/violin.data.js +9 -0
- package/lib/charts/glance/violin.js +185 -0
- package/lib/charts/glance/violin.tenors.json.js +5 -0
- package/lib/charts/hooks.js +154 -0
- package/lib/charts/hover.js +19 -0
- package/lib/charts/lupi/arc-matrix.data.js +83 -0
- package/lib/charts/lupi/arc-matrix.js +146 -0
- package/lib/charts/lupi/ballot-tally.data.js +22 -0
- package/lib/charts/lupi/ballot-tally.js +125 -0
- package/lib/charts/lupi/barcode-lollipop.data.js +195 -0
- package/lib/charts/lupi/barcode-lollipop.js +161 -0
- package/lib/charts/lupi/brand-spectrum.data.js +70 -0
- package/lib/charts/lupi/brand-spectrum.js +233 -0
- package/lib/charts/lupi/bubble-almanac.data.js +689 -0
- package/lib/charts/lupi/bubble-almanac.js +164 -0
- package/lib/charts/lupi/calendar-heat.data.js +399 -0
- package/lib/charts/lupi/calendar-heat.js +175 -0
- package/lib/charts/lupi/cluster-field.data.js +83 -0
- package/lib/charts/lupi/cluster-field.js +173 -0
- package/lib/charts/lupi/dot-cascade.data.js +54 -0
- package/lib/charts/lupi/dot-cascade.js +124 -0
- package/lib/charts/lupi/dotty-matrix.data.js +170 -0
- package/lib/charts/lupi/dotty-matrix.js +126 -0
- package/lib/charts/lupi/hourglass-stream.data.js +30 -0
- package/lib/charts/lupi/hourglass-stream.js +158 -0
- package/lib/charts/lupi/hundred-field.data.js +38 -0
- package/lib/charts/lupi/hundred-field.js +237 -0
- package/lib/charts/lupi/launch-fan.data.js +315 -0
- package/lib/charts/lupi/launch-fan.js +198 -0
- package/lib/charts/lupi/matrix-heat.data.js +97 -0
- package/lib/charts/lupi/matrix-heat.js +246 -0
- package/lib/charts/lupi/parallel-coordinates.data.js +54 -0
- package/lib/charts/lupi/parallel-coordinates.js +218 -0
- package/lib/charts/lupi/radial-convergence.data.js +178 -0
- package/lib/charts/lupi/radial-convergence.js +208 -0
- package/lib/charts/lupi/radial-patchwork.data.js +454 -0
- package/lib/charts/lupi/radial-patchwork.js +181 -0
- package/lib/charts/lupi/ridgeline.data.js +1834 -0
- package/lib/charts/lupi/ridgeline.js +195 -0
- package/lib/charts/lupi/trend-lineage.data.js +51 -0
- package/lib/charts/lupi/trend-lineage.js +198 -0
- package/lib/charts/lupi/type-colonnade.data.js +18 -0
- package/lib/charts/lupi/type-colonnade.js +198 -0
- package/lib/charts/lupi/util-a.js +14 -0
- package/lib/charts/lupi/util-b.js +12 -0
- package/lib/charts/maps/choropleth.js +295 -0
- package/lib/charts/maps/geo.js +84 -0
- package/lib/charts/maps/legend.js +83 -0
- package/lib/charts/maps/step-fill.js +9 -0
- package/lib/charts/maps/us-choropleth.data.js +249 -0
- package/lib/charts/maps/us-choropleth.js +41 -0
- package/lib/charts/maps/world-choropleth.data.js +681 -0
- package/lib/charts/maps/world-choropleth.js +46 -0
- package/lib/charts/markers.js +35 -0
- package/lib/charts/marks.js +31 -0
- package/lib/charts/motion.js +11 -0
- package/lib/charts/originals/daily-users.data.js +101 -0
- package/lib/charts/originals/daily-users.js +203 -0
- package/lib/charts/originals/feature-rank.data.js +92 -0
- package/lib/charts/originals/feature-rank.js +167 -0
- package/lib/charts/originals/format.js +5 -0
- package/lib/charts/originals/key.js +26 -0
- package/lib/charts/originals/response-time.data.js +98 -0
- package/lib/charts/originals/response-time.js +187 -0
- package/lib/charts/originals/revenue-by-plan.data.js +26 -0
- package/lib/charts/originals/revenue-by-plan.js +248 -0
- package/lib/charts/playback.js +68 -0
- package/lib/charts/plot-note.js +27 -0
- package/lib/charts/roles.js +5 -0
- package/lib/charts/rules.js +66 -0
- package/lib/charts/scale-context.js +6 -0
- package/lib/charts/shapes.js +8 -0
- package/lib/charts/shared-options.js +25 -0
- package/lib/charts/svg.js +43 -0
- package/lib/charts/text.js +30 -0
- package/lib/charts/texture-ids.js +20 -0
- package/lib/charts/texture.js +286 -0
- package/lib/charts/util.js +43 -0
- package/lib/charts/value-grid.js +26 -0
- package/lib/draw.js +27 -0
- package/lib/entries/dumbbell-queue.js +2 -0
- package/lib/entries/hairline-area.js +2 -0
- package/lib/entries/hairline-line.js +2 -0
- package/lib/entries/plumb-scatter.js +2 -0
- package/lib/entries/rung-bars.js +2 -0
- package/lib/entries/slope.js +2 -0
- package/lib/frame.js +2 -0
- package/lib/hairline.css +1385 -0
- package/lib/index.js +72 -0
- package/lib/json-schema/dumbbell-queue.json +258 -0
- package/lib/json-schema/hairline-area.json +262 -0
- package/lib/json-schema/hairline-line.json +256 -0
- package/lib/json-schema/index.json +50 -0
- package/lib/json-schema/plumb-scatter.json +363 -0
- package/lib/json-schema/rung-bars.json +230 -0
- package/lib/json-schema/slope.json +333 -0
- package/lib/kit.js +16 -0
- package/lib/lib/format.js +29 -0
- package/lib/lib/random.js +8 -0
- package/lib/maps.js +4 -0
- package/lib/schema/daily.js +9 -0
- package/lib/schema/dumbbell-queue.js +28 -0
- package/lib/schema/format.js +72 -0
- package/lib/schema/hairline-area.js +24 -0
- package/lib/schema/hairline-line.js +23 -0
- package/lib/schema/key.js +4 -0
- package/lib/schema/metrics.js +26 -0
- package/lib/schema/motion.js +12 -0
- package/lib/schema/options.js +21 -0
- package/lib/schema/plumb-scatter.js +48 -0
- package/lib/schema/registry.js +132 -0
- package/lib/schema/rung-bars.js +25 -0
- package/lib/schema/scale.js +9 -0
- package/lib/schema/slope.js +28 -0
- package/lib/schema/validate.js +25 -0
- package/lib/schema.js +16 -0
- package/lib/theme/derive.js +98 -0
- package/lib/theme.css +443 -0
- package/lib/theme.js +1 -0
- package/lib/tokens.css +306 -0
- package/lib/types/charts/axes.d.ts +14 -0
- package/lib/types/charts/basics/candlestick.d.ts +22 -0
- package/lib/types/charts/basics/candlestick.data.d.ts +10 -0
- package/lib/types/charts/basics/daily-empty.d.ts +7 -0
- package/lib/types/charts/basics/daily-readings.d.ts +38 -0
- package/lib/types/charts/basics/dot-heat.d.ts +19 -0
- package/lib/types/charts/basics/dot-heat.data.d.ts +28 -0
- package/lib/types/charts/basics/dumbbell-queue.d.ts +15 -0
- package/lib/types/charts/basics/hairline-area.d.ts +18 -0
- package/lib/types/charts/basics/hairline-line.d.ts +18 -0
- package/lib/types/charts/basics/nested-treemap.d.ts +18 -0
- package/lib/types/charts/basics/nested-treemap.data.d.ts +30 -0
- package/lib/types/charts/basics/paired-rungs.d.ts +21 -0
- package/lib/types/charts/basics/paired-rungs.data.d.ts +43 -0
- package/lib/types/charts/basics/plumb-scatter.d.ts +14 -0
- package/lib/types/charts/basics/rung-bars.d.ts +16 -0
- package/lib/types/charts/basics/rung-geometry.d.ts +6 -0
- package/lib/types/charts/basics/rung-histogram.d.ts +22 -0
- package/lib/types/charts/basics/rung-histogram.data.d.ts +34 -0
- package/lib/types/charts/basics/rung-waterfall.d.ts +19 -0
- package/lib/types/charts/basics/rung-waterfall.data.d.ts +31 -0
- package/lib/types/charts/basics/rungs.d.ts +28 -0
- package/lib/types/charts/basics/series-key.d.ts +19 -0
- package/lib/types/charts/basics/stacked-rungs.d.ts +20 -0
- package/lib/types/charts/basics/stacked-rungs.data.d.ts +26 -0
- package/lib/types/charts/basics/stream-ribbon.d.ts +19 -0
- package/lib/types/charts/basics/stream-ribbon.data.d.ts +29 -0
- package/lib/types/charts/basics/tick-box.d.ts +19 -0
- package/lib/types/charts/basics/tick-box.data.d.ts +30 -0
- package/lib/types/charts/basics/tick-donut.d.ts +24 -0
- package/lib/types/charts/basics/tick-donut.data.d.ts +25 -0
- package/lib/types/charts/basics/tick-gauge.d.ts +22 -0
- package/lib/types/charts/basics/tick-gauge.data.d.ts +24 -0
- package/lib/types/charts/basics/tick-rows.d.ts +18 -0
- package/lib/types/charts/basics/tick-rows.data.d.ts +23 -0
- package/lib/types/charts/basics/util-a.d.ts +10 -0
- package/lib/types/charts/basics/util-b.d.ts +13 -0
- package/lib/types/charts/big/circular-graph.d.ts +20 -0
- package/lib/types/charts/big/circular-graph.data.d.ts +46 -0
- package/lib/types/charts/big/force-galaxy-model.d.ts +109 -0
- package/lib/types/charts/big/force-galaxy.d.ts +18 -0
- package/lib/types/charts/big/force-galaxy.data.d.ts +48 -0
- package/lib/types/charts/big/thread-triptych.d.ts +17 -0
- package/lib/types/charts/big/thread-triptych.data.d.ts +41 -0
- package/lib/types/charts/board/room.d.ts +18 -0
- package/lib/types/charts/board/slope.d.ts +14 -0
- package/lib/types/charts/board/spread.d.ts +5 -0
- package/lib/types/charts/control.d.ts +17 -0
- package/lib/types/charts/core.d.ts +77 -0
- package/lib/types/charts/data-table.d.ts +18 -0
- package/lib/types/charts/fills.d.ts +103 -0
- package/lib/types/charts/forms/area-difference.d.ts +9 -0
- package/lib/types/charts/forms/area-difference.data.d.ts +26 -0
- package/lib/types/charts/forms/brush-math.d.ts +19 -0
- package/lib/types/charts/forms/brush-strip.d.ts +19 -0
- package/lib/types/charts/forms/brushed-overview.d.ts +12 -0
- package/lib/types/charts/forms/brushed-overview.data.d.ts +16 -0
- package/lib/types/charts/forms/chord-ring.d.ts +12 -0
- package/lib/types/charts/forms/chord-ring.data.d.ts +29 -0
- package/lib/types/charts/forms/circle-pack.d.ts +9 -0
- package/lib/types/charts/forms/circle-pack.data.d.ts +23 -0
- package/lib/types/charts/forms/hatched-stack.d.ts +10 -0
- package/lib/types/charts/forms/hatched-stack.data.d.ts +36 -0
- package/lib/types/charts/forms/radial-year.d.ts +8 -0
- package/lib/types/charts/forms/radial-year.data.d.ts +17 -0
- package/lib/types/charts/frame.d.ts +21 -0
- package/lib/types/charts/glance/aggregate-sankey.d.ts +23 -0
- package/lib/types/charts/glance/aggregate-sankey.data.d.ts +32 -0
- package/lib/types/charts/glance/bar-race.d.ts +20 -0
- package/lib/types/charts/glance/bar-race.data.d.ts +32 -0
- package/lib/types/charts/glance/big-slice.d.ts +27 -0
- package/lib/types/charts/glance/big-slice.data.d.ts +30 -0
- package/lib/types/charts/glance/chunky-bars.d.ts +18 -0
- package/lib/types/charts/glance/chunky-bars.data.d.ts +24 -0
- package/lib/types/charts/glance/circular-graph.d.ts +19 -0
- package/lib/types/charts/glance/circular-graph.data.d.ts +43 -0
- package/lib/types/charts/glance/control-slot.d.ts +9 -0
- package/lib/types/charts/glance/diverging-bar.d.ts +19 -0
- package/lib/types/charts/glance/diverging-bar.data.d.ts +27 -0
- package/lib/types/charts/glance/dot-waffle.d.ts +19 -0
- package/lib/types/charts/glance/dot-waffle.data.d.ts +31 -0
- package/lib/types/charts/glance/draw-in.d.ts +20 -0
- package/lib/types/charts/glance/draw-in.data.d.ts +6 -0
- package/lib/types/charts/glance/dynamic-stream.d.ts +22 -0
- package/lib/types/charts/glance/dynamic-stream.data.d.ts +7 -0
- package/lib/types/charts/glance/force-graph.d.ts +16 -0
- package/lib/types/charts/glance/force-graph.data.d.ts +45 -0
- package/lib/types/charts/glance/jitter-strip.d.ts +24 -0
- package/lib/types/charts/glance/jitter-strip.data.d.ts +27 -0
- package/lib/types/charts/glance/link-bundle.d.ts +22 -0
- package/lib/types/charts/glance/matrix-heat-glance.d.ts +22 -0
- package/lib/types/charts/glance/matrix-heat-glance.data.d.ts +35 -0
- package/lib/types/charts/glance/pictorial-bar.d.ts +20 -0
- package/lib/types/charts/glance/pictorial-bar.data.d.ts +27 -0
- package/lib/types/charts/glance/rainfall-dual-area.d.ts +19 -0
- package/lib/types/charts/glance/rainfall-dual-area.data.d.ts +32 -0
- package/lib/types/charts/glance/rank-strip.d.ts +19 -0
- package/lib/types/charts/glance/rank-strip.data.d.ts +36 -0
- package/lib/types/charts/glance/scatter-labels.d.ts +23 -0
- package/lib/types/charts/glance/scatter-morph.d.ts +22 -0
- package/lib/types/charts/glance/scatter-morph.data.d.ts +30 -0
- package/lib/types/charts/glance/single-axis.d.ts +27 -0
- package/lib/types/charts/glance/single-axis.data.d.ts +6 -0
- package/lib/types/charts/glance/stagger-wave.d.ts +18 -0
- package/lib/types/charts/glance/stagger-wave.data.d.ts +26 -0
- package/lib/types/charts/glance/tree-lr.d.ts +16 -0
- package/lib/types/charts/glance/tree-lr.data.d.ts +27 -0
- package/lib/types/charts/glance/util-a.d.ts +31 -0
- package/lib/types/charts/glance/util-b.d.ts +12 -0
- package/lib/types/charts/glance/violin.d.ts +22 -0
- package/lib/types/charts/glance/violin.data.d.ts +24 -0
- package/lib/types/charts/hooks.d.ts +109 -0
- package/lib/types/charts/hover.d.ts +26 -0
- package/lib/types/charts/lupi/arc-matrix.d.ts +18 -0
- package/lib/types/charts/lupi/arc-matrix.data.d.ts +28 -0
- package/lib/types/charts/lupi/ballot-tally.d.ts +19 -0
- package/lib/types/charts/lupi/ballot-tally.data.d.ts +28 -0
- package/lib/types/charts/lupi/barcode-lollipop.d.ts +19 -0
- package/lib/types/charts/lupi/barcode-lollipop.data.d.ts +26 -0
- package/lib/types/charts/lupi/brand-spectrum.d.ts +28 -0
- package/lib/types/charts/lupi/brand-spectrum.data.d.ts +34 -0
- package/lib/types/charts/lupi/bubble-almanac.d.ts +22 -0
- package/lib/types/charts/lupi/bubble-almanac.data.d.ts +45 -0
- package/lib/types/charts/lupi/calendar-heat.d.ts +19 -0
- package/lib/types/charts/lupi/calendar-heat.data.d.ts +20 -0
- package/lib/types/charts/lupi/cluster-field.d.ts +21 -0
- package/lib/types/charts/lupi/cluster-field.data.d.ts +52 -0
- package/lib/types/charts/lupi/dot-cascade.d.ts +22 -0
- package/lib/types/charts/lupi/dot-cascade.data.d.ts +24 -0
- package/lib/types/charts/lupi/dotty-matrix.d.ts +17 -0
- package/lib/types/charts/lupi/dotty-matrix.data.d.ts +32 -0
- package/lib/types/charts/lupi/hourglass-stream.d.ts +18 -0
- package/lib/types/charts/lupi/hourglass-stream.data.d.ts +27 -0
- package/lib/types/charts/lupi/hundred-field.d.ts +18 -0
- package/lib/types/charts/lupi/hundred-field.data.d.ts +24 -0
- package/lib/types/charts/lupi/launch-fan.d.ts +37 -0
- package/lib/types/charts/lupi/launch-fan.data.d.ts +41 -0
- package/lib/types/charts/lupi/matrix-heat.d.ts +20 -0
- package/lib/types/charts/lupi/matrix-heat.data.d.ts +29 -0
- package/lib/types/charts/lupi/parallel-coordinates.d.ts +23 -0
- package/lib/types/charts/lupi/parallel-coordinates.data.d.ts +40 -0
- package/lib/types/charts/lupi/radial-convergence.d.ts +15 -0
- package/lib/types/charts/lupi/radial-convergence.data.d.ts +24 -0
- package/lib/types/charts/lupi/radial-patchwork.d.ts +16 -0
- package/lib/types/charts/lupi/radial-patchwork.data.d.ts +35 -0
- package/lib/types/charts/lupi/ridgeline.d.ts +23 -0
- package/lib/types/charts/lupi/ridgeline.data.d.ts +19 -0
- package/lib/types/charts/lupi/trend-lineage.d.ts +18 -0
- package/lib/types/charts/lupi/trend-lineage.data.d.ts +56 -0
- package/lib/types/charts/lupi/type-colonnade.d.ts +20 -0
- package/lib/types/charts/lupi/type-colonnade.data.d.ts +30 -0
- package/lib/types/charts/lupi/util-a.d.ts +9 -0
- package/lib/types/charts/lupi/util-b.d.ts +11 -0
- package/lib/types/charts/maps/choropleth.d.ts +33 -0
- package/lib/types/charts/maps/geo.d.ts +48 -0
- package/lib/types/charts/maps/legend.d.ts +14 -0
- package/lib/types/charts/maps/step-fill.d.ts +6 -0
- package/lib/types/charts/maps/us-choropleth.d.ts +25 -0
- package/lib/types/charts/maps/us-choropleth.data.d.ts +23 -0
- package/lib/types/charts/maps/world-choropleth.d.ts +22 -0
- package/lib/types/charts/maps/world-choropleth.data.d.ts +35 -0
- package/lib/types/charts/markers.d.ts +42 -0
- package/lib/types/charts/marks.d.ts +58 -0
- package/lib/types/charts/motion.d.ts +12 -0
- package/lib/types/charts/originals/daily-users.d.ts +13 -0
- package/lib/types/charts/originals/daily-users.data.d.ts +17 -0
- package/lib/types/charts/originals/feature-rank.d.ts +13 -0
- package/lib/types/charts/originals/feature-rank.data.d.ts +29 -0
- package/lib/types/charts/originals/format.d.ts +2 -0
- package/lib/types/charts/originals/key.d.ts +16 -0
- package/lib/types/charts/originals/response-time.d.ts +11 -0
- package/lib/types/charts/originals/response-time.data.d.ts +24 -0
- package/lib/types/charts/originals/revenue-by-plan.d.ts +12 -0
- package/lib/types/charts/originals/revenue-by-plan.data.d.ts +26 -0
- package/lib/types/charts/playback.d.ts +42 -0
- package/lib/types/charts/plot-note.d.ts +37 -0
- package/lib/types/charts/roles.d.ts +28 -0
- package/lib/types/charts/rules.d.ts +62 -0
- package/lib/types/charts/scale-context.d.ts +3 -0
- package/lib/types/charts/shapes.d.ts +9 -0
- package/lib/types/charts/shared-options.d.ts +25 -0
- package/lib/types/charts/svg.d.ts +24 -0
- package/lib/types/charts/text.d.ts +36 -0
- package/lib/types/charts/texture-ids.d.ts +24 -0
- package/lib/types/charts/texture.d.ts +185 -0
- package/lib/types/charts/util.d.ts +66 -0
- package/lib/types/charts/value-grid.d.ts +22 -0
- package/lib/types/draw.d.ts +279 -0
- package/lib/types/entries/dumbbell-queue.d.ts +2 -0
- package/lib/types/entries/hairline-area.d.ts +2 -0
- package/lib/types/entries/hairline-line.d.ts +2 -0
- package/lib/types/entries/plumb-scatter.d.ts +2 -0
- package/lib/types/entries/rung-bars.d.ts +2 -0
- package/lib/types/entries/slope.d.ts +2 -0
- package/lib/types/frame.d.ts +2 -0
- package/lib/types/index.d.ts +82 -0
- package/lib/types/kit.d.ts +22 -0
- package/lib/types/lib/format.d.ts +58 -0
- package/lib/types/lib/random.d.ts +5 -0
- package/lib/types/maps.d.ts +2 -0
- package/lib/types/schema/daily.d.ts +14 -0
- package/lib/types/schema/dumbbell-queue.d.ts +91 -0
- package/lib/types/schema/format.d.ts +101 -0
- package/lib/types/schema/hairline-area.d.ts +83 -0
- package/lib/types/schema/hairline-line.d.ts +85 -0
- package/lib/types/schema/key.d.ts +12 -0
- package/lib/types/schema/metrics.d.ts +26 -0
- package/lib/types/schema/motion.d.ts +22 -0
- package/lib/types/schema/options.d.ts +51 -0
- package/lib/types/schema/plumb-scatter.d.ts +124 -0
- package/lib/types/schema/registry.d.ts +309 -0
- package/lib/types/schema/rung-bars.d.ts +84 -0
- package/lib/types/schema/scale.d.ts +34 -0
- package/lib/types/schema/slope.d.ts +120 -0
- package/lib/types/schema/validate.d.ts +29 -0
- package/lib/types/schema.d.ts +30 -0
- package/lib/types/theme/derive.d.ts +23 -0
- package/lib/types/theme.d.ts +2 -0
- package/lib/vendor/us-atlas/states-10m.json.js +13855 -0
- package/lib/vendor/world-atlas/countries-110m.json.js +9357 -0
- package/package.json +162 -4
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useHover as e } from "../hooks.js";
|
|
3
|
+
import { Plot as t, Tooltip as n } from "../core.js";
|
|
4
|
+
import { clamp as r, noteSpace as i, sansWidth as a, stagger as o } from "../util.js";
|
|
5
|
+
import { DimGroup as s, TipText as c } from "../hover.js";
|
|
6
|
+
import { FootNote as l } from "../plot-note.js";
|
|
7
|
+
import { ChartSvg as u } from "../svg.js";
|
|
8
|
+
import { Label as d } from "../text.js";
|
|
9
|
+
import { HALFTONE_R as f, TEXTURE_PITCH as p, useTextureIds as m } from "../texture-ids.js";
|
|
10
|
+
import { DotScreen as h, PlateLabel as g } from "../texture.js";
|
|
11
|
+
import { mainCentroid as _ } from "./geo.js";
|
|
12
|
+
import { stepFill as v } from "./step-fill.js";
|
|
13
|
+
import { Legend as y } from "./legend.js";
|
|
14
|
+
import { useMemo as b, useState as x } from "react";
|
|
15
|
+
import { scaleThreshold as S } from "d3-scale";
|
|
16
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
17
|
+
import { geoContains as T, geoPath as E } from "d3-geo";
|
|
18
|
+
//#region src/charts/maps/choropleth.tsx
|
|
19
|
+
var D = 52, O = 28, k = f.map((e) => ({
|
|
20
|
+
pitch: p.screen,
|
|
21
|
+
r: e,
|
|
22
|
+
tone: "fill-l3"
|
|
23
|
+
})), A = "fill-hero", j = (e, t) => e.solid ? { className: A } : v(e.bin, t), M = (e) => /* @__PURE__ */ C("defs", { children: k.map((t, n) => /* @__PURE__ */ C(h, {
|
|
24
|
+
id: `${e.pid}-${n}`,
|
|
25
|
+
pitch: t.pitch,
|
|
26
|
+
r: t.r,
|
|
27
|
+
tone: t.tone
|
|
28
|
+
}, `${t.pitch}-${t.r}`)) }), N = ({ hero: e, mapH: t, project: n, regions: r, thresholds: i, values: a, width: o }) => {
|
|
29
|
+
let s = {
|
|
30
|
+
features: r.map((e) => e.feature),
|
|
31
|
+
type: "FeatureCollection"
|
|
32
|
+
}, c = n([o, t], s), l = E(c), u = S().domain(i).range([
|
|
33
|
+
0,
|
|
34
|
+
1,
|
|
35
|
+
2,
|
|
36
|
+
3,
|
|
37
|
+
4
|
|
38
|
+
]), d = [];
|
|
39
|
+
for (let t of r) {
|
|
40
|
+
let n = l(t.feature) ?? "";
|
|
41
|
+
if (n === "") continue;
|
|
42
|
+
let r = a.get(t.key)?.value, i = (e, n) => {
|
|
43
|
+
let r = c.invert?.([e, n]);
|
|
44
|
+
return r != null && T(t.feature, r);
|
|
45
|
+
}, o = r === void 0 ? -1 : u(r);
|
|
46
|
+
d.push({
|
|
47
|
+
anchor: _(t.feature, l),
|
|
48
|
+
bin: o,
|
|
49
|
+
covers: (e) => i(e.x0, e.y0) && i(e.x1, e.y0) && i(e.x0, e.y1) && i(e.x1, e.y1),
|
|
50
|
+
d: n,
|
|
51
|
+
key: t.key,
|
|
52
|
+
name: t.name,
|
|
53
|
+
solid: t.key === e && o === k.length - 1
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return d;
|
|
57
|
+
}, P = "stroke-l5", F = (e) => /* @__PURE__ */ C("g", {
|
|
58
|
+
className: "transition-opacity group-data-[focus=true]/map:opacity-30",
|
|
59
|
+
children: e.territories.map((t) => {
|
|
60
|
+
let n = j(t, e.pid);
|
|
61
|
+
return /* @__PURE__ */ C("path", {
|
|
62
|
+
className: `fade ${P} ${n.className}`,
|
|
63
|
+
d: t.d,
|
|
64
|
+
"data-key": t.key,
|
|
65
|
+
fill: n.fill,
|
|
66
|
+
strokeLinejoin: "round",
|
|
67
|
+
strokeWidth: 1,
|
|
68
|
+
style: o(Math.round(t.anchor[0] / e.width * 24), "mark")
|
|
69
|
+
}, t.key);
|
|
70
|
+
})
|
|
71
|
+
}), I = (e) => e < 0 ? "end" : e > 0 ? "start" : "middle", L = 8, R = [
|
|
72
|
+
0,
|
|
73
|
+
-1,
|
|
74
|
+
1,
|
|
75
|
+
-2,
|
|
76
|
+
2
|
|
77
|
+
], z = 4, B = (e) => {
|
|
78
|
+
let t = Math.ceil(a(e.text, 11)) + 8, n = {
|
|
79
|
+
end: t,
|
|
80
|
+
middle: t / 2,
|
|
81
|
+
start: 0
|
|
82
|
+
}[e.anchor];
|
|
83
|
+
return {
|
|
84
|
+
x0: e.x - n,
|
|
85
|
+
x1: e.x - n + t,
|
|
86
|
+
y0: e.y - L,
|
|
87
|
+
y1: e.y + L
|
|
88
|
+
};
|
|
89
|
+
}, V = (e) => {
|
|
90
|
+
let t = B(e);
|
|
91
|
+
return {
|
|
92
|
+
x0: t.x0 + z,
|
|
93
|
+
x1: t.x1 - z,
|
|
94
|
+
y0: e.y - 4,
|
|
95
|
+
y1: e.y + 4
|
|
96
|
+
};
|
|
97
|
+
}, H = (e) => !e.leader && e.solid && e.covers(V(e)), U = (e, t) => e.x0 < t.x1 && t.x0 < e.x1 && e.y0 < t.y1 && t.y0 < e.y1, W = (e, t) => {
|
|
98
|
+
let n = B(e), i = r(0, 2 - n.x0, t - 2 - n.x1);
|
|
99
|
+
return {
|
|
100
|
+
...e,
|
|
101
|
+
x: e.x + i
|
|
102
|
+
};
|
|
103
|
+
}, G = (e, t) => {
|
|
104
|
+
let n = {
|
|
105
|
+
...e,
|
|
106
|
+
text: t
|
|
107
|
+
};
|
|
108
|
+
return e.covers(V(n)) ? n : e;
|
|
109
|
+
}, K = (e, t, n, r) => {
|
|
110
|
+
let i = t.values.get(e), a = i?.dx ?? 0, o = i?.dy ?? 0, s = a !== 0 || o !== 0;
|
|
111
|
+
if (n === void 0 || i === void 0 || s && t.narrow) return null;
|
|
112
|
+
let c = {
|
|
113
|
+
anchor: I(a),
|
|
114
|
+
ax: n.anchor[0],
|
|
115
|
+
ay: n.anchor[1],
|
|
116
|
+
covers: n.covers,
|
|
117
|
+
dy: o,
|
|
118
|
+
key: e,
|
|
119
|
+
leader: s,
|
|
120
|
+
solid: n.solid,
|
|
121
|
+
text: `${i.label ?? e} ${t.short(i.value)}`,
|
|
122
|
+
x: n.anchor[0] + a,
|
|
123
|
+
y: n.anchor[1] + o
|
|
124
|
+
};
|
|
125
|
+
return !t.narrow || n.covers(V(c)) ? c : r ? G(c, i.label ?? e) : null;
|
|
126
|
+
}, q = (e) => {
|
|
127
|
+
let t = [], n = new Map(e.territories.map((e) => [e.key, e]));
|
|
128
|
+
for (let r of e.labels) {
|
|
129
|
+
let i = K(r, e, n.get(r), t.length === 0);
|
|
130
|
+
if (i === null) continue;
|
|
131
|
+
let a = R.map((t) => W({
|
|
132
|
+
...i,
|
|
133
|
+
dy: t === 0 ? i.dy : t * L * 2,
|
|
134
|
+
leader: i.leader || t !== 0,
|
|
135
|
+
y: i.y + t * L * 2
|
|
136
|
+
}, e.width)).find((e) => t.every((t) => !U(B(e), B(t))));
|
|
137
|
+
a !== void 0 && t.push(a);
|
|
138
|
+
}
|
|
139
|
+
return t;
|
|
140
|
+
}, J = (e) => /* @__PURE__ */ C("g", {
|
|
141
|
+
className: "pointer-events-none",
|
|
142
|
+
children: q(e).map((t, n) => /* @__PURE__ */ C("g", {
|
|
143
|
+
className: "fade",
|
|
144
|
+
style: o(10 + n, "mark"),
|
|
145
|
+
children: /* @__PURE__ */ w(s, {
|
|
146
|
+
dim: e.lit !== null && !e.lit.has(t.key),
|
|
147
|
+
children: [t.leader && /* @__PURE__ */ C("line", {
|
|
148
|
+
className: "rule",
|
|
149
|
+
x1: t.ax,
|
|
150
|
+
x2: t.x,
|
|
151
|
+
y1: t.ay,
|
|
152
|
+
y2: t.y + (t.dy < 0 ? 5 : -5)
|
|
153
|
+
}), t.leader ? /* @__PURE__ */ C(d, {
|
|
154
|
+
anchor: t.anchor,
|
|
155
|
+
dy: "0.35em",
|
|
156
|
+
halo: !0,
|
|
157
|
+
voice: "value",
|
|
158
|
+
x: t.x,
|
|
159
|
+
y: t.y,
|
|
160
|
+
children: t.text
|
|
161
|
+
}) : /* @__PURE__ */ C(g, {
|
|
162
|
+
anchor: t.anchor,
|
|
163
|
+
hero: H(t),
|
|
164
|
+
text: t.text,
|
|
165
|
+
x: t.x,
|
|
166
|
+
y: t.y
|
|
167
|
+
})]
|
|
168
|
+
})
|
|
169
|
+
}, t.key))
|
|
170
|
+
}), Y = (e) => /* @__PURE__ */ C("g", {
|
|
171
|
+
className: "pointer-events-none",
|
|
172
|
+
children: e.lit.map((t) => {
|
|
173
|
+
let n = j(t, e.pid);
|
|
174
|
+
return /* @__PURE__ */ C("path", {
|
|
175
|
+
className: `stroke-ink ${n.className}`,
|
|
176
|
+
d: t.d,
|
|
177
|
+
fill: n.fill,
|
|
178
|
+
strokeLinejoin: "round",
|
|
179
|
+
strokeWidth: 1
|
|
180
|
+
}, t.key);
|
|
181
|
+
})
|
|
182
|
+
}), X = (e) => {
|
|
183
|
+
let { focus: t, hover: n, onFocus: r, values: a, width: o } = e, s = Math.round(Math.min(e.maxHeight ?? Infinity, o * e.aspect)), c = s + D + i(e.note, o - 16, 18), { project: d, regions: f, thresholds: p } = e, h = m("map")("screen"), g = e.labels.at(0), _ = b(() => N({
|
|
184
|
+
hero: g,
|
|
185
|
+
mapH: s,
|
|
186
|
+
project: d,
|
|
187
|
+
regions: f,
|
|
188
|
+
thresholds: p,
|
|
189
|
+
values: a,
|
|
190
|
+
width: o
|
|
191
|
+
}), [
|
|
192
|
+
g,
|
|
193
|
+
s,
|
|
194
|
+
d,
|
|
195
|
+
f,
|
|
196
|
+
p,
|
|
197
|
+
a,
|
|
198
|
+
o
|
|
199
|
+
]), v = b(() => /* @__PURE__ */ C(F, {
|
|
200
|
+
pid: h,
|
|
201
|
+
territories: _,
|
|
202
|
+
width: o
|
|
203
|
+
}), [
|
|
204
|
+
h,
|
|
205
|
+
_,
|
|
206
|
+
o
|
|
207
|
+
]), x = t?.kind === "region" ? _.find((e) => e.key === t.key)?.bin ?? null : t?.bin ?? null, S = t === null ? [] : _.filter((e) => t.kind === "region" ? e.key === t.key : e.bin === t.bin), T = (e) => {
|
|
208
|
+
let { target: i } = e;
|
|
209
|
+
if (!(i instanceof SVGElement)) return;
|
|
210
|
+
let { key: a } = i.dataset;
|
|
211
|
+
if (a === void 0) return;
|
|
212
|
+
(t?.kind !== "region" || t.key !== a) && r({
|
|
213
|
+
key: a,
|
|
214
|
+
kind: "region"
|
|
215
|
+
});
|
|
216
|
+
let o = (e.currentTarget.ownerSVGElement ?? e.currentTarget).getBoundingClientRect();
|
|
217
|
+
n.show(a, e.clientX - o.left, e.clientY - o.top - 6);
|
|
218
|
+
}, E = () => {
|
|
219
|
+
r(null), n.clear();
|
|
220
|
+
};
|
|
221
|
+
return /* @__PURE__ */ w(u, {
|
|
222
|
+
className: "group/map",
|
|
223
|
+
"data-focus": t !== null,
|
|
224
|
+
height: c,
|
|
225
|
+
label: e.ariaLabel,
|
|
226
|
+
leave: E,
|
|
227
|
+
width: o,
|
|
228
|
+
children: [
|
|
229
|
+
/* @__PURE__ */ C(M, { pid: h }),
|
|
230
|
+
/* @__PURE__ */ C("g", {
|
|
231
|
+
onPointerLeave: E,
|
|
232
|
+
onPointerMove: T,
|
|
233
|
+
children: v
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ C(Y, {
|
|
236
|
+
lit: S,
|
|
237
|
+
pid: h
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ C(J, {
|
|
240
|
+
labels: e.labels,
|
|
241
|
+
lit: t === null ? null : new Set(S.map((e) => e.key)),
|
|
242
|
+
narrow: o < 560,
|
|
243
|
+
short: e.short,
|
|
244
|
+
territories: _,
|
|
245
|
+
values: a,
|
|
246
|
+
width: o
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ C(y, {
|
|
249
|
+
active: x,
|
|
250
|
+
emptyLabel: e.emptyLabel,
|
|
251
|
+
onStep: (e) => {
|
|
252
|
+
n.clear(), r(e === null ? null : {
|
|
253
|
+
bin: e,
|
|
254
|
+
kind: "bin"
|
|
255
|
+
});
|
|
256
|
+
},
|
|
257
|
+
pid: h,
|
|
258
|
+
short: e.short,
|
|
259
|
+
thresholds: p,
|
|
260
|
+
width: o,
|
|
261
|
+
y: s + O
|
|
262
|
+
}),
|
|
263
|
+
/* @__PURE__ */ C(l, {
|
|
264
|
+
height: c,
|
|
265
|
+
text: e.note,
|
|
266
|
+
width: o
|
|
267
|
+
})
|
|
268
|
+
]
|
|
269
|
+
});
|
|
270
|
+
}, Z = (r) => {
|
|
271
|
+
let [i, a] = x(null), o = e(), s = b(() => new Map(r.data.map((e) => [e.key, e])), [r.data]), l = b(() => new Map(r.regions.map((e) => [e.key, e.name])), [r.regions]);
|
|
272
|
+
return /* @__PURE__ */ C(t, {
|
|
273
|
+
overlay: o.at === null ? null : /* @__PURE__ */ C(n, {
|
|
274
|
+
x: o.at.x,
|
|
275
|
+
y: o.at.y,
|
|
276
|
+
children: /* @__PURE__ */ C(c, {
|
|
277
|
+
facts: [((e) => {
|
|
278
|
+
let t = s.get(e);
|
|
279
|
+
return t === void 0 ? r.emptyLabel ?? "No data" : `${r.format(t.value)}${r.unit === void 0 ? "" : ` ${r.unit}`}`;
|
|
280
|
+
})(o.at.key)],
|
|
281
|
+
lead: l.get(o.at.key) ?? ""
|
|
282
|
+
})
|
|
283
|
+
}),
|
|
284
|
+
children: (e) => /* @__PURE__ */ C(X, {
|
|
285
|
+
...r,
|
|
286
|
+
focus: i,
|
|
287
|
+
hover: o,
|
|
288
|
+
onFocus: a,
|
|
289
|
+
values: s,
|
|
290
|
+
width: e
|
|
291
|
+
})
|
|
292
|
+
});
|
|
293
|
+
};
|
|
294
|
+
//#endregion
|
|
295
|
+
export { Z as Choropleth };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { geoArea as e, geoCentroid as t, geoDistance as n } from "d3-geo";
|
|
3
|
+
import { feature as r } from "topojson-client";
|
|
4
|
+
//#region src/charts/maps/geo.ts
|
|
5
|
+
var i = (e) => e.type === "Topology", a = (e, t, n) => {
|
|
6
|
+
if (!i(e)) throw Error("Expected a TopoJSON topology");
|
|
7
|
+
let { geometries: a } = e.objects[t], o = r(e, e.objects[t]), s = o.type === "FeatureCollection" ? o.features : [o], c = [];
|
|
8
|
+
for (let [e, t] of s.entries()) {
|
|
9
|
+
let r = a[e].id ?? "", { name: i } = a[e].properties;
|
|
10
|
+
c.push({
|
|
11
|
+
feature: t,
|
|
12
|
+
key: n(r, i),
|
|
13
|
+
name: i
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return c;
|
|
17
|
+
}, o = (t, n) => {
|
|
18
|
+
let { geometry: r } = t;
|
|
19
|
+
if (r.type !== "MultiPolygon") return n.centroid(t);
|
|
20
|
+
let i = null, a = -1;
|
|
21
|
+
for (let t of r.coordinates) {
|
|
22
|
+
let n = {
|
|
23
|
+
coordinates: t,
|
|
24
|
+
type: "Polygon"
|
|
25
|
+
}, r = e(n);
|
|
26
|
+
r > a && (a = r, i = n);
|
|
27
|
+
}
|
|
28
|
+
return i === null ? n.centroid(t) : n.centroid(i);
|
|
29
|
+
}, s = (e) => e * 180 / Math.PI, c = (r) => {
|
|
30
|
+
let i = {
|
|
31
|
+
coordinates: r,
|
|
32
|
+
type: "Polygon"
|
|
33
|
+
}, a = t(i), o = 0;
|
|
34
|
+
for (let e of r[0]) o = Math.max(o, s(n(a, [e[0], e[1]])));
|
|
35
|
+
return {
|
|
36
|
+
area: e(i),
|
|
37
|
+
centre: a,
|
|
38
|
+
r: o
|
|
39
|
+
};
|
|
40
|
+
}, l = (e, t) => Math.max(0, s(n(e.centre, t.centre)) - e.r - t.r), u = (e, t) => {
|
|
41
|
+
let n = e.map((e, t) => t), r = (e) => n[e] === e ? e : r(n[e]);
|
|
42
|
+
for (let [i, a] of e.entries()) for (let [o, s] of e.entries()) o > i && l(a, s) < t && (n[r(i)] = r(o));
|
|
43
|
+
return e.map((e, t) => r(t));
|
|
44
|
+
}, d = (e) => {
|
|
45
|
+
let { geometry: t } = e.feature;
|
|
46
|
+
if (t.type !== "MultiPolygon") return e;
|
|
47
|
+
let n = t.coordinates.map(c), r = u(n, 5), i = Math.max(...n.map((e) => e.area)), a = r[n.findIndex((e) => e.area === i)], o = /* @__PURE__ */ new Set();
|
|
48
|
+
for (let e of new Set(r)) {
|
|
49
|
+
let t = n.flatMap((t, n) => r[n] === e ? [n] : []), s = t.reduce((e, t) => e + n[t].area, 0), c = Math.min(...t.flatMap((t) => n.flatMap((i, a) => r[a] === e ? [] : [l(n[t], i)])));
|
|
50
|
+
if (e !== a && s < i * .01 && c > 15) for (let e of t) o.add(e);
|
|
51
|
+
}
|
|
52
|
+
return o.size === 0 ? e : {
|
|
53
|
+
...e,
|
|
54
|
+
feature: {
|
|
55
|
+
...e.feature,
|
|
56
|
+
geometry: {
|
|
57
|
+
coordinates: t.coordinates.filter((e, t) => !o.has(t)),
|
|
58
|
+
type: "MultiPolygon"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}, f = 179, p = (t) => {
|
|
63
|
+
let { geometry: n } = t.feature;
|
|
64
|
+
if (n.type !== "MultiPolygon") return t;
|
|
65
|
+
let r = n.coordinates.map((t) => e({
|
|
66
|
+
coordinates: t,
|
|
67
|
+
type: "Polygon"
|
|
68
|
+
})), i = Math.max(...r), a = n.coordinates.filter((e, t) => {
|
|
69
|
+
let n = e[0].map((e) => e[0]), a = Math.min(...n) < -179 && Math.max(...n) > f;
|
|
70
|
+
return r[t] === i || !a;
|
|
71
|
+
});
|
|
72
|
+
return a.length === n.coordinates.length ? t : {
|
|
73
|
+
...t,
|
|
74
|
+
feature: {
|
|
75
|
+
...t.feature,
|
|
76
|
+
geometry: {
|
|
77
|
+
coordinates: a,
|
|
78
|
+
type: "MultiPolygon"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { o as mainCentroid, a as regionsFrom, d as withoutRemoteIslets, p as withoutWrappedParts };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { clamp as e, sansWidth as t } from "../util.js";
|
|
3
|
+
import { DimGroup as n, HitRect as r } from "../hover.js";
|
|
4
|
+
import { KEY as i } from "../marks.js";
|
|
5
|
+
import { Label as a } from "../text.js";
|
|
6
|
+
import { KeySwatch as o } from "../texture.js";
|
|
7
|
+
import { stepFill as s } from "./step-fill.js";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
|
+
//#region src/charts/maps/legend.tsx
|
|
10
|
+
var u = i.swatch, d = i.gap, f = i.entryGap, p = 44, m = (n) => {
|
|
11
|
+
let r = n.thresholds, i = [
|
|
12
|
+
...n.emptyLabel === void 0 ? [] : [{
|
|
13
|
+
bin: -1,
|
|
14
|
+
label: n.emptyLabel
|
|
15
|
+
}],
|
|
16
|
+
{
|
|
17
|
+
bin: 0,
|
|
18
|
+
label: `<${n.short(r[0])}`
|
|
19
|
+
},
|
|
20
|
+
...r.map((e, t) => ({
|
|
21
|
+
bin: t + 1,
|
|
22
|
+
label: `${n.short(e)}+`
|
|
23
|
+
}))
|
|
24
|
+
].map((e) => {
|
|
25
|
+
let n = u + d + t(e.label, 12);
|
|
26
|
+
return {
|
|
27
|
+
...e,
|
|
28
|
+
slot: Math.max(p, Math.ceil(n)),
|
|
29
|
+
w: n
|
|
30
|
+
};
|
|
31
|
+
}), a = n.width - i.reduce((e, t) => e + t.slot, 0), o = e(a / Math.max(1, i.length - 1), 0, f), s = [], c = 0;
|
|
32
|
+
for (let e of i) s.push({
|
|
33
|
+
...e,
|
|
34
|
+
x: c
|
|
35
|
+
}), c += e.slot + o;
|
|
36
|
+
return s;
|
|
37
|
+
}, h = (e) => {
|
|
38
|
+
let { k: t } = e, i = s(t.bin, e.pid), f = t.x + (t.slot - t.w) / 2;
|
|
39
|
+
return /* @__PURE__ */ l(n, {
|
|
40
|
+
dim: e.active !== null && e.active !== t.bin,
|
|
41
|
+
onPointerEnter: () => {
|
|
42
|
+
e.onStep(t.bin);
|
|
43
|
+
},
|
|
44
|
+
onPointerLeave: () => {
|
|
45
|
+
e.onStep(null);
|
|
46
|
+
},
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ c(r, {
|
|
49
|
+
height: p,
|
|
50
|
+
width: t.slot,
|
|
51
|
+
x: t.x,
|
|
52
|
+
y: -22
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ c(o, {
|
|
55
|
+
fill: i.fill,
|
|
56
|
+
tone: i.fill === void 0 ? i.className : void 0,
|
|
57
|
+
x: f,
|
|
58
|
+
y: -u / 2
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ c(a, {
|
|
61
|
+
className: "pointer-events-none",
|
|
62
|
+
dy: "0.35em",
|
|
63
|
+
voice: "axis",
|
|
64
|
+
x: f + u + d,
|
|
65
|
+
y: 0,
|
|
66
|
+
children: t.label
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
}, g = (e) => e === void 0 ? 0 : (e.slot - e.w) / 2, _ = (e) => {
|
|
71
|
+
let t = m(e), n = t.at(-1), r = n === void 0 ? 0 : n.x + n.slot, i = g(n) - g(t.at(0)), a = Math.round(Math.max(0, (e.width - r + i) / 2));
|
|
72
|
+
return /* @__PURE__ */ c("g", {
|
|
73
|
+
transform: `translate(${a}, ${Math.round(e.y)})`,
|
|
74
|
+
children: t.map((t) => /* @__PURE__ */ c(h, {
|
|
75
|
+
active: e.active,
|
|
76
|
+
k: t,
|
|
77
|
+
onStep: e.onStep,
|
|
78
|
+
pid: e.pid
|
|
79
|
+
}, t.bin))
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
//#endregion
|
|
83
|
+
export { _ as Legend };
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { regionsFrom as e } from "./geo.js";
|
|
3
|
+
import t from "../../vendor/us-atlas/states-10m.json.js";
|
|
4
|
+
//#region src/charts/maps/us-choropleth.data.ts
|
|
5
|
+
var n = /* @__PURE__ */ new Map([
|
|
6
|
+
["01", "AL"],
|
|
7
|
+
["02", "AK"],
|
|
8
|
+
["04", "AZ"],
|
|
9
|
+
["05", "AR"],
|
|
10
|
+
["06", "CA"],
|
|
11
|
+
["08", "CO"],
|
|
12
|
+
["09", "CT"],
|
|
13
|
+
["10", "DE"],
|
|
14
|
+
["11", "DC"],
|
|
15
|
+
["12", "FL"],
|
|
16
|
+
["13", "GA"],
|
|
17
|
+
["15", "HI"],
|
|
18
|
+
["16", "ID"],
|
|
19
|
+
["17", "IL"],
|
|
20
|
+
["18", "IN"],
|
|
21
|
+
["19", "IA"],
|
|
22
|
+
["20", "KS"],
|
|
23
|
+
["21", "KY"],
|
|
24
|
+
["22", "LA"],
|
|
25
|
+
["23", "ME"],
|
|
26
|
+
["24", "MD"],
|
|
27
|
+
["25", "MA"],
|
|
28
|
+
["26", "MI"],
|
|
29
|
+
["27", "MN"],
|
|
30
|
+
["28", "MS"],
|
|
31
|
+
["29", "MO"],
|
|
32
|
+
["30", "MT"],
|
|
33
|
+
["31", "NE"],
|
|
34
|
+
["32", "NV"],
|
|
35
|
+
["33", "NH"],
|
|
36
|
+
["34", "NJ"],
|
|
37
|
+
["35", "NM"],
|
|
38
|
+
["36", "NY"],
|
|
39
|
+
["37", "NC"],
|
|
40
|
+
["38", "ND"],
|
|
41
|
+
["39", "OH"],
|
|
42
|
+
["40", "OK"],
|
|
43
|
+
["41", "OR"],
|
|
44
|
+
["42", "PA"],
|
|
45
|
+
["44", "RI"],
|
|
46
|
+
["45", "SC"],
|
|
47
|
+
["46", "SD"],
|
|
48
|
+
["47", "TN"],
|
|
49
|
+
["48", "TX"],
|
|
50
|
+
["49", "UT"],
|
|
51
|
+
["50", "VT"],
|
|
52
|
+
["51", "VA"],
|
|
53
|
+
["53", "WA"],
|
|
54
|
+
["54", "WV"],
|
|
55
|
+
["55", "WI"],
|
|
56
|
+
["56", "WY"],
|
|
57
|
+
["72", "PR"]
|
|
58
|
+
]), r = e(t, "states", (e) => n.get(e) ?? e), i = [
|
|
59
|
+
{
|
|
60
|
+
state: "OR",
|
|
61
|
+
value: 4823877
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
state: "NC",
|
|
65
|
+
value: 3208419
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
state: "MI",
|
|
69
|
+
value: 1799391
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
state: "WA",
|
|
73
|
+
value: 936904
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
state: "PA",
|
|
77
|
+
value: 721480
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
state: "WI",
|
|
81
|
+
value: 601199
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
state: "VA",
|
|
85
|
+
value: 578777
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
state: "NY",
|
|
89
|
+
value: 318745
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
state: "OH",
|
|
93
|
+
value: 189240
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
state: "MN",
|
|
97
|
+
value: 153600
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
state: "CA",
|
|
101
|
+
value: 130730
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
state: "VT",
|
|
105
|
+
value: 127121
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
state: "ME",
|
|
109
|
+
value: 94425
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
state: "CT",
|
|
113
|
+
value: 88893
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
state: "NH",
|
|
117
|
+
value: 79323
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
state: "MA",
|
|
121
|
+
value: 78630
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
state: "IL",
|
|
125
|
+
value: 68681
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
state: "GA",
|
|
129
|
+
value: 63915
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
state: "IN",
|
|
133
|
+
value: 60841
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
state: "NJ",
|
|
137
|
+
value: 58817
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
state: "TX",
|
|
141
|
+
value: 43668
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
state: "MD",
|
|
145
|
+
value: 40697
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
state: "WV",
|
|
149
|
+
value: 39391
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
state: "AL",
|
|
153
|
+
value: 24586
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
state: "SC",
|
|
157
|
+
value: 23317
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
state: "IA",
|
|
161
|
+
value: 21826
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
state: "MO",
|
|
165
|
+
value: 21461
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
state: "OK",
|
|
169
|
+
value: 21352
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
state: "ID",
|
|
173
|
+
value: 15980
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
state: "TN",
|
|
177
|
+
value: 12129
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
state: "RI",
|
|
181
|
+
value: 11936
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
state: "KS",
|
|
185
|
+
value: 11204
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
state: "MS",
|
|
189
|
+
value: 11175
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
state: "LA",
|
|
193
|
+
value: 10825
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
state: "NE",
|
|
197
|
+
value: 10417
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
state: "AR",
|
|
201
|
+
value: 8410
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
state: "FL",
|
|
205
|
+
value: 8353
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
state: "MT",
|
|
209
|
+
value: 6338
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
state: "KY",
|
|
213
|
+
value: 4748
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
state: "CO",
|
|
217
|
+
value: 4667
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
state: "NM",
|
|
221
|
+
value: 2693
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
state: "HI",
|
|
225
|
+
value: 2570
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
state: "SD",
|
|
229
|
+
value: 2380
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
state: "DE",
|
|
233
|
+
value: 1780
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
state: "UT",
|
|
237
|
+
value: 1722
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
state: "WY",
|
|
241
|
+
value: 244
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
state: "ND",
|
|
245
|
+
value: 227
|
|
246
|
+
}
|
|
247
|
+
];
|
|
248
|
+
//#endregion
|
|
249
|
+
export { i as usChoroplethDemo, r as usStates };
|