@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,229 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { plural as e } from "../../lib/format.js";
|
|
3
|
+
import { resolveFormat as t } from "../../schema/format.js";
|
|
4
|
+
import { keyOf as n } from "../../schema/key.js";
|
|
5
|
+
import { useHover as r } from "../hooks.js";
|
|
6
|
+
import { Plot as i, Tooltip as a } from "../core.js";
|
|
7
|
+
import { hasText as o, noteLines as s, noteOf as c, sansWidth as l, stagger as u } from "../util.js";
|
|
8
|
+
import { DimGroup as d, HitRect as f, TipText as p } from "../hover.js";
|
|
9
|
+
import { crisp as m } from "../axes.js";
|
|
10
|
+
import { Dot as h } from "../markers.js";
|
|
11
|
+
import { FootNote as g } from "../plot-note.js";
|
|
12
|
+
import { HRule as _, Stem as v } from "../rules.js";
|
|
13
|
+
import { chartTable as y, plotOptions as b, scoped as x } from "../shared-options.js";
|
|
14
|
+
import { ChartSvg as S } from "../svg.js";
|
|
15
|
+
import { Label as C } from "../text.js";
|
|
16
|
+
import { TEXTURE_PITCH as w } from "../texture-ids.js";
|
|
17
|
+
import { DottedLine as T } from "../texture.js";
|
|
18
|
+
import { scaleLinear as E } from "d3-scale";
|
|
19
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
20
|
+
//#region src/charts/basics/plumb-scatter.tsx
|
|
21
|
+
var k = ({ floor: e, highName: t, lowName: n, x0: r, x1: i, yLabel: a }) => /* @__PURE__ */ O("g", { children: [
|
|
22
|
+
/* @__PURE__ */ D(_, {
|
|
23
|
+
x0: Math.round(r),
|
|
24
|
+
x1: Math.round(i),
|
|
25
|
+
y: e
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ D(C, {
|
|
28
|
+
voice: "axis",
|
|
29
|
+
x: r,
|
|
30
|
+
y: e + 20,
|
|
31
|
+
children: n
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ D(C, {
|
|
34
|
+
anchor: "end",
|
|
35
|
+
voice: "axis",
|
|
36
|
+
x: i,
|
|
37
|
+
y: e + 20,
|
|
38
|
+
children: t
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ D(C, {
|
|
41
|
+
voice: "axis",
|
|
42
|
+
x: r,
|
|
43
|
+
y: 20,
|
|
44
|
+
children: a
|
|
45
|
+
})
|
|
46
|
+
] }), A = (e) => e ? "pop fill-hero" : "pop fill-l3", j = 2, M = {
|
|
47
|
+
anchor: "middle",
|
|
48
|
+
dx: 0,
|
|
49
|
+
dy: -12
|
|
50
|
+
}, N = [
|
|
51
|
+
M,
|
|
52
|
+
{
|
|
53
|
+
anchor: "start",
|
|
54
|
+
dx: 10,
|
|
55
|
+
dy: 4
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
anchor: "end",
|
|
59
|
+
dx: -10,
|
|
60
|
+
dy: 4
|
|
61
|
+
}
|
|
62
|
+
], P = (e, t, n) => e.anchor === "middle" ? [t - n / 2, t + n / 2] : e.anchor === "start" ? [t + e.dx, t + e.dx + n] : [t + e.dx - n, t + e.dx], F = (e, t, n, r) => {
|
|
63
|
+
let i = (t) => {
|
|
64
|
+
let [r, i] = P(t, e.px, e.w);
|
|
65
|
+
return r >= j && i <= n - j && e.py + t.dy - 10 > 0;
|
|
66
|
+
}, a = (n) => {
|
|
67
|
+
let [r, i] = P(n, e.px, e.w);
|
|
68
|
+
return t.every((t) => t.px === e.px || t.px < r - 4 || t.px > i + 4 || t.py > e.py + n.dy + 2);
|
|
69
|
+
}, o = N.find((e) => i(e) && a(e));
|
|
70
|
+
if (o !== void 0 || !r) return o;
|
|
71
|
+
let s = e.w / 2;
|
|
72
|
+
return N.find(i) ?? {
|
|
73
|
+
...M,
|
|
74
|
+
dx: Math.max(j + s - e.px, Math.min(0, n - j - s - e.px))
|
|
75
|
+
};
|
|
76
|
+
}, I = ({ datum: e, dim: t, floor: n, format: r, hero: i, onEnter: a, order: o, place: s, x: c, y: l }) => {
|
|
77
|
+
let p = c(e.x), g = l(e.y), _ = s !== void 0;
|
|
78
|
+
return /* @__PURE__ */ O(d, {
|
|
79
|
+
dim: t,
|
|
80
|
+
onPointerEnter: () => {
|
|
81
|
+
a(p, g - (_ ? 28 : 10));
|
|
82
|
+
},
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ D(f, {
|
|
85
|
+
height: n - g + 10,
|
|
86
|
+
width: 18,
|
|
87
|
+
x: p - 9,
|
|
88
|
+
y: g - 10
|
|
89
|
+
}),
|
|
90
|
+
i ? /* @__PURE__ */ D(v, {
|
|
91
|
+
className: "grow-y stroke-hero",
|
|
92
|
+
hero: !0,
|
|
93
|
+
style: u(o, "mark"),
|
|
94
|
+
x: p,
|
|
95
|
+
y0: Math.round(n),
|
|
96
|
+
y1: g
|
|
97
|
+
}) : /* @__PURE__ */ D("g", {
|
|
98
|
+
className: "fade",
|
|
99
|
+
style: u(o, "mark"),
|
|
100
|
+
children: /* @__PURE__ */ D(T, {
|
|
101
|
+
pitch: w.dense,
|
|
102
|
+
tone: "fill-l3",
|
|
103
|
+
x0: p,
|
|
104
|
+
x1: p,
|
|
105
|
+
y0: g + 4,
|
|
106
|
+
y1: n - 2
|
|
107
|
+
})
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ D(h, {
|
|
110
|
+
className: A(i),
|
|
111
|
+
cx: m(p),
|
|
112
|
+
cy: g,
|
|
113
|
+
size: i ? "md" : "sm",
|
|
114
|
+
style: u(o + 6, "mark")
|
|
115
|
+
}),
|
|
116
|
+
s === void 0 ? null : /* @__PURE__ */ O(C, {
|
|
117
|
+
anchor: s.anchor,
|
|
118
|
+
halo: !0,
|
|
119
|
+
order: o + 8,
|
|
120
|
+
tier: "mark",
|
|
121
|
+
voice: i ? "label" : "axis",
|
|
122
|
+
x: p + s.dx,
|
|
123
|
+
y: g + s.dy,
|
|
124
|
+
children: [
|
|
125
|
+
e.label,
|
|
126
|
+
" · ",
|
|
127
|
+
r(e.y)
|
|
128
|
+
]
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
}, L = (e) => {
|
|
133
|
+
let t = /* @__PURE__ */ new Map();
|
|
134
|
+
return e.map((e) => {
|
|
135
|
+
let r = n(e), i = t.get(r) ?? 0;
|
|
136
|
+
return t.set(r, i + 1), `${r}#${i}`;
|
|
137
|
+
});
|
|
138
|
+
}, R = (e) => {
|
|
139
|
+
if (e.length === 0) return [0, 1];
|
|
140
|
+
let t = Math.min(...e), n = Math.floor((t - 10) / 10) * 10, r = t < 0 ? n : Math.max(0, n), i = Math.max(...e);
|
|
141
|
+
return [r, i > r ? i : r + 1];
|
|
142
|
+
}, z = (e) => {
|
|
143
|
+
if (e.length === 0) return [0, 10];
|
|
144
|
+
let t = Math.min(...e) < 0 ? Math.floor(Math.min(...e) * 1.12 / 10) * 10 : 0, n = Math.ceil(Math.max(...e) * 1.12 / 10) * 10;
|
|
145
|
+
return [t, n > t ? n : t + 10];
|
|
146
|
+
}, B = (e, t, r) => {
|
|
147
|
+
if (t === void 0) return new Set(r);
|
|
148
|
+
let i = new Set(t);
|
|
149
|
+
return new Set(e.flatMap((e, t) => i.has(n(e)) ? [t] : []));
|
|
150
|
+
}, V = (t, n) => {
|
|
151
|
+
if (t.length === 0) return "No data.";
|
|
152
|
+
let r = t.map((e) => e.y), i = t[r.indexOf(Math.max(...r))], a = t[r.indexOf(Math.min(...r))];
|
|
153
|
+
return `${e(t.length, "point")}. Highest: ${i.label}, ${n(i.y)}. Lowest: ${a.label}, ${n(a.y)}. The data table lists every point.`;
|
|
154
|
+
}, H = (e, t, n) => e.length === 0 ? "No data" : e.map((e) => `${e.label}: ${t(e.x)}, ${n(e.y)}`).join("; "), U = (e, t, n, r) => e === null ? null : /* @__PURE__ */ D(a, {
|
|
155
|
+
x: e.x,
|
|
156
|
+
y: e.y,
|
|
157
|
+
children: /* @__PURE__ */ D(p, {
|
|
158
|
+
facts: [n(t[e.key].x), r(t[e.key].y)],
|
|
159
|
+
lead: t[e.key].label
|
|
160
|
+
})
|
|
161
|
+
}), W = (e) => {
|
|
162
|
+
let a = (e.data ?? []).filter((e) => Number.isFinite(e.x) && Number.isFinite(e.y)), u = e.height ?? 440, d = t(e.format), f = e.formatX === void 0 ? (e) => `${Math.round(e)}` : t(e.formatX), [p, m] = e.xLabels ?? ["Low", "High"], h = o(c(e)), _ = r(), v = a.map((e) => e.y), x = a.map((e) => e.x), C = L(a), w = v.length === 0 ? -1 : v.indexOf(Math.max(...v)), T = v.length === 0 ? -1 : v.indexOf(Math.min(...v)), A = e.emphasis === void 0 ? w : a.findIndex((t) => n(t) === e.emphasis), j = B(a, e.labelled, [w, T]), M = e.xDomain ?? z(x), N = e.yDomain ?? R(v), P = a.map((e, t) => ({
|
|
163
|
+
i: t,
|
|
164
|
+
x: e.x
|
|
165
|
+
})).toSorted((e, t) => e.x - t.x), W = new Map(P.map((e, t) => [e.i, t])), G = e.title ?? H(a, f, d);
|
|
166
|
+
return /* @__PURE__ */ D(i, {
|
|
167
|
+
...b(e),
|
|
168
|
+
initialWidth: e.initialWidth,
|
|
169
|
+
table: y(e, e.title ?? "Points", [
|
|
170
|
+
"Label",
|
|
171
|
+
"X",
|
|
172
|
+
"Y"
|
|
173
|
+
], a.map((e) => [
|
|
174
|
+
e.label,
|
|
175
|
+
f(e.x),
|
|
176
|
+
d(e.y)
|
|
177
|
+
])),
|
|
178
|
+
width: e.width,
|
|
179
|
+
overlay: U(_.at, a, f, d),
|
|
180
|
+
children: (t) => {
|
|
181
|
+
let n = Math.min(t - 4, 600), r = (t - n) / 2, i = s(c(e), t - 24, e.metrics), o = Math.round(u) - (h ? 58 : 36) - Math.max(0, i.length - 1) * 12, f = E().domain(M).range([r, r + n]), v = E().domain(N).range([o - 14, 46]);
|
|
182
|
+
return /* @__PURE__ */ O(S, {
|
|
183
|
+
desc: V(a, d),
|
|
184
|
+
height: u,
|
|
185
|
+
label: G,
|
|
186
|
+
leave: _.clear,
|
|
187
|
+
width: t,
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ D(k, {
|
|
190
|
+
floor: o,
|
|
191
|
+
highName: m,
|
|
192
|
+
lowName: p,
|
|
193
|
+
x0: r,
|
|
194
|
+
x1: r + n,
|
|
195
|
+
yLabel: e.yLabel ?? "Higher ↑"
|
|
196
|
+
}),
|
|
197
|
+
a.map((n, r) => /* @__PURE__ */ D(I, {
|
|
198
|
+
place: j.has(r) ? F({
|
|
199
|
+
px: f(n.x),
|
|
200
|
+
py: v(n.y),
|
|
201
|
+
w: l(`${n.label} · ${d(n.y)}`, A === r ? 12 : 11, e.metrics)
|
|
202
|
+
}, a.map((e) => ({
|
|
203
|
+
px: f(e.x),
|
|
204
|
+
py: v(e.y)
|
|
205
|
+
})), t, A === r) : void 0,
|
|
206
|
+
datum: n,
|
|
207
|
+
dim: _.dim(r),
|
|
208
|
+
floor: o,
|
|
209
|
+
format: d,
|
|
210
|
+
hero: A === r,
|
|
211
|
+
onEnter: _.showAt(r),
|
|
212
|
+
order: W.get(r) ?? r,
|
|
213
|
+
x: f,
|
|
214
|
+
y: v
|
|
215
|
+
}, C[r])),
|
|
216
|
+
/* @__PURE__ */ D(g, {
|
|
217
|
+
gutter: 12,
|
|
218
|
+
height: u,
|
|
219
|
+
metrics: e.metrics,
|
|
220
|
+
text: c(e),
|
|
221
|
+
width: t
|
|
222
|
+
})
|
|
223
|
+
]
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}, G = (e) => x(e.idPrefix, /* @__PURE__ */ D(W, { ...e }));
|
|
228
|
+
//#endregion
|
|
229
|
+
export { G as PlumbScatter };
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { plural as e } from "../../lib/format.js";
|
|
3
|
+
import { resolveFormat as t } from "../../schema/format.js";
|
|
4
|
+
import { keyOf as n } from "../../schema/key.js";
|
|
5
|
+
import { useHover as r } from "../hooks.js";
|
|
6
|
+
import { Plot as i, Tooltip as a } from "../core.js";
|
|
7
|
+
import { countingUnit as o, noteOf as s, noteSpace as c, sansWidth as l, stagger as u } from "../util.js";
|
|
8
|
+
import { DimGroup as d, HitRect as f, TipText as p } from "../hover.js";
|
|
9
|
+
import { FootNote as m } from "../plot-note.js";
|
|
10
|
+
import { HRule as h } from "../rules.js";
|
|
11
|
+
import { chartTable as g, plotOptions as _, scoped as v } from "../shared-options.js";
|
|
12
|
+
import { ChartSvg as y } from "../svg.js";
|
|
13
|
+
import { Label as b } from "../text.js";
|
|
14
|
+
import { maxIndex as x } from "./util-b.js";
|
|
15
|
+
import { paint as S, useTextureIds as C } from "../texture-ids.js";
|
|
16
|
+
import { CrossHatch as w, Hatch as T } from "../texture.js";
|
|
17
|
+
import { rungPitch as E, rungY as D } from "./rung-geometry.js";
|
|
18
|
+
import { Rungs as O } from "./rungs.js";
|
|
19
|
+
import { scaleBand as k } from "d3-scale";
|
|
20
|
+
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
21
|
+
//#region src/charts/basics/rung-bars.tsx
|
|
22
|
+
var M = 10, N = .4, P = 10, F = 3, I = 8, L = 14, R = (e, t, n) => {
|
|
23
|
+
let r = e.map((e) => l(e, void 0, n));
|
|
24
|
+
return r.slice(1).some((e, n) => (r[n] + e) / 2 + I > t);
|
|
25
|
+
}, z = (e) => {
|
|
26
|
+
let { floor: t, right: n, shadow: r, top: i } = e, a = [
|
|
27
|
+
[n, i],
|
|
28
|
+
[n + r, i + r],
|
|
29
|
+
[n + r, t],
|
|
30
|
+
[n, t]
|
|
31
|
+
].map((e) => e.join(",")).join(" ");
|
|
32
|
+
return /* @__PURE__ */ A("polygon", {
|
|
33
|
+
className: "fade shape-crisp",
|
|
34
|
+
fill: S(e.tex(e.hero ? "shade-hero" : "shade")),
|
|
35
|
+
points: a,
|
|
36
|
+
style: u(e.index)
|
|
37
|
+
});
|
|
38
|
+
}, B = (e) => {
|
|
39
|
+
let t = D(e.floor, e.rungs - 1, e.pitch), n = e.left + e.bandwidth / 2, r = Math.round(e.left + e.bandwidth);
|
|
40
|
+
return /* @__PURE__ */ j(d, {
|
|
41
|
+
dim: e.dim,
|
|
42
|
+
onPointerEnter: e.onEnter,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ A(f, {
|
|
45
|
+
height: e.floor - t + 24,
|
|
46
|
+
width: e.bandwidth + 12 + e.shadow,
|
|
47
|
+
x: e.left - 6,
|
|
48
|
+
y: t - 24
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ A(z, {
|
|
51
|
+
floor: e.floor,
|
|
52
|
+
hero: e.hero,
|
|
53
|
+
index: e.index,
|
|
54
|
+
right: r,
|
|
55
|
+
shadow: e.shadow,
|
|
56
|
+
tex: e.tex,
|
|
57
|
+
top: t
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ A(O, {
|
|
60
|
+
accent: e.hero ? "fill-hero" : "fill-l2",
|
|
61
|
+
className: e.hero ? "fill-hero" : "fill-l4",
|
|
62
|
+
every: P,
|
|
63
|
+
reach: F,
|
|
64
|
+
floor: e.floor,
|
|
65
|
+
id: e.datum.label,
|
|
66
|
+
left: e.left,
|
|
67
|
+
n: e.rungs,
|
|
68
|
+
order: e.index * 2,
|
|
69
|
+
pitch: e.pitch,
|
|
70
|
+
width: e.bandwidth
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ A(b, {
|
|
73
|
+
anchor: "middle",
|
|
74
|
+
order: e.index,
|
|
75
|
+
voice: "value",
|
|
76
|
+
x: n,
|
|
77
|
+
y: t - 10,
|
|
78
|
+
children: e.format(e.datum.value)
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ A(b, {
|
|
81
|
+
anchor: "middle",
|
|
82
|
+
muted: !0,
|
|
83
|
+
voice: "label",
|
|
84
|
+
x: n,
|
|
85
|
+
y: e.floor + 18 + e.labelDrop,
|
|
86
|
+
children: e.datum.label
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
});
|
|
90
|
+
}, V = (t, n) => {
|
|
91
|
+
if (t.length === 0) return "No data.";
|
|
92
|
+
let r = (e) => `${t[e].label}, ${n(t[e].value)}`, i = x(t.map((e) => e.value)), a = x(t.map((e) => -e.value));
|
|
93
|
+
return `${e(t.length, "bar")}. Largest: ${r(i)}.${t.length > 1 ? ` Smallest: ${r(a)}.` : ""} The data table lists every bar.`;
|
|
94
|
+
}, H = (e) => {
|
|
95
|
+
let t = /* @__PURE__ */ new Map();
|
|
96
|
+
return e.map((e) => {
|
|
97
|
+
let r = n(e), i = t.get(r) ?? 0;
|
|
98
|
+
return t.set(r, i + 1), `${r}#${i}`;
|
|
99
|
+
});
|
|
100
|
+
}, U = (e, t, n) => e === null ? null : /* @__PURE__ */ A(a, {
|
|
101
|
+
x: e.x,
|
|
102
|
+
y: e.y,
|
|
103
|
+
children: /* @__PURE__ */ A(p, {
|
|
104
|
+
facts: [n(t[e.key].value)],
|
|
105
|
+
lead: t[e.key].label
|
|
106
|
+
})
|
|
107
|
+
}), W = (e, t, n) => {
|
|
108
|
+
let r = Math.min(t - 32, e.length * 120), i = (t - r) / 2, a = k().domain(e.map((e, t) => t)).range([i, i + r]).paddingInner(.42).paddingOuter(.3);
|
|
109
|
+
return {
|
|
110
|
+
alternate: R(e.map((e) => e.label), a.step(), n),
|
|
111
|
+
plotWidth: r,
|
|
112
|
+
x: a,
|
|
113
|
+
x0: i
|
|
114
|
+
};
|
|
115
|
+
}, G = (a) => {
|
|
116
|
+
let l = (a.data ?? []).filter((e) => Number.isFinite(e.value)), u = o(a.unit !== void 0 && a.unit > 0 ? a.unit : 1, Math.max(0, ...l.map((e) => e.value))), d = a.width !== void 0 && a.height !== void 0, f = a.height ?? 460, p = t(a.format), v = r(), b = C("counted"), S = a.title ?? `Bar chart of ${e(l.length, "value")}`;
|
|
117
|
+
return /* @__PURE__ */ A(i, {
|
|
118
|
+
..._(a),
|
|
119
|
+
initialWidth: a.initialWidth,
|
|
120
|
+
table: g(a, S, ["Label", "Value"], l.map((e) => [e.label, p(e.value)])),
|
|
121
|
+
width: a.width,
|
|
122
|
+
overlay: U(v.at, l, p),
|
|
123
|
+
children: (e) => {
|
|
124
|
+
let t = {
|
|
125
|
+
bottom: 30 + c(s(a), e - 16, 20, a.metrics),
|
|
126
|
+
top: 28
|
|
127
|
+
}, { alternate: r, plotWidth: i, x: o, x0: g } = W(l, e, a.metrics), _ = t.bottom + (r ? L : 0), C = Math.max(0, ...l.map((e) => e.value / u)), O = E(f - _ - t.top, C), k = Math.round(C) * O, P = d ? f : Math.max(Math.min(f, t.top + Math.ceil(C) * O + _), t.top + k + _), F = Math.round(P - _), I = Math.min(M, Math.round((o.step() - o.bandwidth()) * N)), R = H(l), z = a.emphasis === void 0 ? x(l.map((e) => e.value)) : l.findIndex((e) => n(e) === a.emphasis);
|
|
128
|
+
return /* @__PURE__ */ j(y, {
|
|
129
|
+
desc: V(l, p),
|
|
130
|
+
height: P,
|
|
131
|
+
label: S,
|
|
132
|
+
leave: v.clear,
|
|
133
|
+
width: e,
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ j("defs", { children: [/* @__PURE__ */ A(T, {
|
|
136
|
+
id: b("shade"),
|
|
137
|
+
tone: "fill-l4"
|
|
138
|
+
}), /* @__PURE__ */ A(w, {
|
|
139
|
+
id: b("shade-hero"),
|
|
140
|
+
tone: "fill-l3"
|
|
141
|
+
})] }),
|
|
142
|
+
/* @__PURE__ */ A(h, {
|
|
143
|
+
x0: Math.round(g),
|
|
144
|
+
x1: Math.round(g + i),
|
|
145
|
+
y: F
|
|
146
|
+
}),
|
|
147
|
+
l.map((e, t) => {
|
|
148
|
+
let n = o(t) ?? 0, i = Math.max(0, Math.round(e.value / u));
|
|
149
|
+
return /* @__PURE__ */ A(B, {
|
|
150
|
+
bandwidth: o.bandwidth(),
|
|
151
|
+
datum: e,
|
|
152
|
+
dim: v.dim(t),
|
|
153
|
+
floor: F,
|
|
154
|
+
format: p,
|
|
155
|
+
hero: z === t,
|
|
156
|
+
index: t,
|
|
157
|
+
labelDrop: r && t % 2 == 1 ? L : 0,
|
|
158
|
+
left: n,
|
|
159
|
+
pitch: O,
|
|
160
|
+
rungs: i,
|
|
161
|
+
shadow: I,
|
|
162
|
+
tex: b,
|
|
163
|
+
onEnter: v.enter(t, n + o.bandwidth() / 2, D(F, i - 1, O) - 22)
|
|
164
|
+
}, R[t]);
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ A(m, {
|
|
167
|
+
height: P,
|
|
168
|
+
metrics: a.metrics,
|
|
169
|
+
text: s(a),
|
|
170
|
+
width: e
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}, K = (e) => v(e.idPrefix, /* @__PURE__ */ A(G, { ...e }));
|
|
177
|
+
//#endregion
|
|
178
|
+
export { K as RungBars };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../marks.js";
|
|
3
|
+
//#region src/charts/basics/rung-geometry.ts
|
|
4
|
+
var e = 2, t = (t, n, r = 12) => Math.max(e + 2, Math.min(r, Math.floor(t / Math.max(1, n)))), n = (t, n, r) => Math.round(t) - (n + 1) * r + Math.floor((r - e) / 2);
|
|
5
|
+
//#endregion
|
|
6
|
+
export { e as RUNG, t as rungPitch, n as rungY };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/charts/basics/rung-histogram.data.ts
|
|
3
|
+
var e = [
|
|
4
|
+
79,
|
|
5
|
+
157,
|
|
6
|
+
243,
|
|
7
|
+
285,
|
|
8
|
+
409,
|
|
9
|
+
839,
|
|
10
|
+
512,
|
|
11
|
+
615,
|
|
12
|
+
744,
|
|
13
|
+
746,
|
|
14
|
+
772,
|
|
15
|
+
1058,
|
|
16
|
+
975,
|
|
17
|
+
1019,
|
|
18
|
+
1203,
|
|
19
|
+
1308,
|
|
20
|
+
1390,
|
|
21
|
+
1815,
|
|
22
|
+
1210,
|
|
23
|
+
1248,
|
|
24
|
+
1239,
|
|
25
|
+
1341,
|
|
26
|
+
1334,
|
|
27
|
+
1272,
|
|
28
|
+
1328,
|
|
29
|
+
1164,
|
|
30
|
+
1184,
|
|
31
|
+
1149,
|
|
32
|
+
1134,
|
|
33
|
+
1178,
|
|
34
|
+
895,
|
|
35
|
+
753,
|
|
36
|
+
801,
|
|
37
|
+
703,
|
|
38
|
+
714,
|
|
39
|
+
620,
|
|
40
|
+
581,
|
|
41
|
+
505,
|
|
42
|
+
462,
|
|
43
|
+
438,
|
|
44
|
+
383,
|
|
45
|
+
417,
|
|
46
|
+
276,
|
|
47
|
+
245,
|
|
48
|
+
236,
|
|
49
|
+
208,
|
|
50
|
+
194,
|
|
51
|
+
208,
|
|
52
|
+
151,
|
|
53
|
+
131,
|
|
54
|
+
124,
|
|
55
|
+
121,
|
|
56
|
+
108,
|
|
57
|
+
122
|
|
58
|
+
].map((e, t) => ({
|
|
59
|
+
count: e,
|
|
60
|
+
x0: 150 + t * 5,
|
|
61
|
+
x1: 150 + t * 5 + 5
|
|
62
|
+
})), t = (e) => {
|
|
63
|
+
let t = 0;
|
|
64
|
+
for (let n of e) t += n.count;
|
|
65
|
+
let n = 0;
|
|
66
|
+
for (let r of e) {
|
|
67
|
+
if (n + r.count >= t / 2) return r.x0 + (t / 2 - n) / r.count * (r.x1 - r.x0);
|
|
68
|
+
n += r.count;
|
|
69
|
+
}
|
|
70
|
+
return e.at(-1)?.x1 ?? 0;
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { t as binMedian, e as rungHistogramDemo };
|
|
@@ -0,0 +1,153 @@
|
|
|
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, stagger as i } from "../util.js";
|
|
5
|
+
import { DimGroup as a, HitRect as o, TipText as s } from "../hover.js";
|
|
6
|
+
import { FootNote as c } from "../plot-note.js";
|
|
7
|
+
import { HRule as l, Tick as u } from "../rules.js";
|
|
8
|
+
import { ChartSvg as d } from "../svg.js";
|
|
9
|
+
import { Label as f } from "../text.js";
|
|
10
|
+
import { maxIndex as p } from "./util-b.js";
|
|
11
|
+
import { DottedLine as m } from "../texture.js";
|
|
12
|
+
import { rungPitch as h, rungY as g } from "./rung-geometry.js";
|
|
13
|
+
import { Rungs as _ } from "./rungs.js";
|
|
14
|
+
import { binMedian as v, rungHistogramDemo as y } from "./rung-histogram.data.js";
|
|
15
|
+
import { scaleLinear as b } from "d3-scale";
|
|
16
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
17
|
+
//#region src/charts/basics/rung-histogram.tsx
|
|
18
|
+
var C = (e) => `${Math.floor(e / 60)}:${String(e % 60).padStart(2, "0")}`, w = (e, t, n, r, i) => {
|
|
19
|
+
let a = Math.min(e - 36, n.length * 58), o = (e - a) / 2, s = Math.round(t - (i ? 66 : 36)), c = Math.max(1, ...n.map((e) => Math.round(e.count / r))), l = n[0]?.x0 ?? 0, u = n.at(-1)?.x1 ?? 1;
|
|
20
|
+
return {
|
|
21
|
+
floor: s,
|
|
22
|
+
pitch: h(s - 34 - 6, c, 18),
|
|
23
|
+
plotW: a,
|
|
24
|
+
top: 34,
|
|
25
|
+
x: b().domain([l, u]).range([o, o + a]),
|
|
26
|
+
x0: o
|
|
27
|
+
};
|
|
28
|
+
}, T = (e) => {
|
|
29
|
+
let { layout: t } = e, n = e.data.at(-1), r = [...e.data.map((e) => e.x0), ...n === void 0 ? [] : [n.x1]], i = Math.max(1, e.every * (t.plotW / e.data.length < 34 ? 2 : 1)), a = t.floor + 4;
|
|
30
|
+
return /* @__PURE__ */ S("g", { children: [/* @__PURE__ */ x(l, {
|
|
31
|
+
x0: Math.round(t.x0 - 8),
|
|
32
|
+
x1: Math.round(t.x0 + t.plotW + 8),
|
|
33
|
+
y: a
|
|
34
|
+
}), r.map((n, r) => /* @__PURE__ */ S("g", { children: [/* @__PURE__ */ x(u, {
|
|
35
|
+
size: r % i === 0 ? "md" : "sm",
|
|
36
|
+
x: t.x(n),
|
|
37
|
+
y: a + 1
|
|
38
|
+
}), r % i === 0 ? /* @__PURE__ */ x(f, {
|
|
39
|
+
anchor: "middle",
|
|
40
|
+
voice: "axis",
|
|
41
|
+
x: t.x(n),
|
|
42
|
+
y: t.floor + 30,
|
|
43
|
+
children: e.formatX(n)
|
|
44
|
+
}) : null] }, n))] });
|
|
45
|
+
}, E = (e) => {
|
|
46
|
+
let { bin: t, layout: n, index: r } = e, i = Math.round(t.count / e.unit), s = n.x(t.x0), c = n.x(t.x1) - s, l = g(n.floor, i - 1, n.pitch), u = Math.min(l, n.floor - 30) - 12;
|
|
47
|
+
return /* @__PURE__ */ S(a, {
|
|
48
|
+
dim: e.dim,
|
|
49
|
+
onPointerEnter: () => {
|
|
50
|
+
e.onHover(s + c / 2, l - (e.peak ? 26 : 6));
|
|
51
|
+
},
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ x(o, {
|
|
54
|
+
height: n.floor - u,
|
|
55
|
+
width: c,
|
|
56
|
+
x: s,
|
|
57
|
+
y: u
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ x(_, {
|
|
60
|
+
accent: e.peak ? "fill-hero" : "fill-l2",
|
|
61
|
+
className: e.peak ? "fill-hero" : "fill-l4",
|
|
62
|
+
floor: n.floor,
|
|
63
|
+
id: `bin-${t.x0}`,
|
|
64
|
+
left: s + c * .12,
|
|
65
|
+
n: i,
|
|
66
|
+
order: r * 1.6,
|
|
67
|
+
pitch: n.pitch,
|
|
68
|
+
width: c * .76
|
|
69
|
+
}),
|
|
70
|
+
e.peak ? /* @__PURE__ */ x(f, {
|
|
71
|
+
anchor: "middle",
|
|
72
|
+
order: r,
|
|
73
|
+
tier: "series",
|
|
74
|
+
voice: "value",
|
|
75
|
+
x: s + c / 2,
|
|
76
|
+
y: l - 10,
|
|
77
|
+
children: e.format(t.count)
|
|
78
|
+
}) : null
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}, D = (e) => {
|
|
82
|
+
let { layout: t } = e, n = t.x(e.value), r = n > t.x0 + t.plotW * .7;
|
|
83
|
+
return /* @__PURE__ */ S("g", {
|
|
84
|
+
className: "fade",
|
|
85
|
+
pointerEvents: "none",
|
|
86
|
+
style: i(10),
|
|
87
|
+
children: [/* @__PURE__ */ x(m, {
|
|
88
|
+
tone: "fill-l2",
|
|
89
|
+
x0: n,
|
|
90
|
+
x1: n,
|
|
91
|
+
y0: t.top - 2,
|
|
92
|
+
y1: t.floor + 3
|
|
93
|
+
}), /* @__PURE__ */ x(f, {
|
|
94
|
+
anchor: r ? "end" : "start",
|
|
95
|
+
halo: !0,
|
|
96
|
+
voice: "axis",
|
|
97
|
+
x: n + (r ? -8 : 8),
|
|
98
|
+
y: t.top + 2,
|
|
99
|
+
children: e.label
|
|
100
|
+
})]
|
|
101
|
+
});
|
|
102
|
+
}, O = (i) => {
|
|
103
|
+
let a = i.data ?? y, o = i.height ?? 440, l = i.unit ?? 1, u = i.formatX ?? C, f = i.format ?? String, m = i.marker === void 0 ? v(a) : i.marker, h = p(a.map((e) => e.count)), g = e(), _ = a.map((e) => `${u(e.x0)}–${u(e.x1)}: ${f(e.count)}`).join(", "), b = a[0]?.x0 ?? 0, O = a.at(-1)?.x1 ?? 0;
|
|
104
|
+
return /* @__PURE__ */ x(t, {
|
|
105
|
+
overlay: g.at === null ? null : /* @__PURE__ */ x(n, {
|
|
106
|
+
x: g.at.x,
|
|
107
|
+
y: g.at.y,
|
|
108
|
+
children: /* @__PURE__ */ x(s, {
|
|
109
|
+
facts: [f(a[g.at.key].count)],
|
|
110
|
+
lead: `${u(a[g.at.key].x0)}–${u(a[g.at.key].x1)}`
|
|
111
|
+
})
|
|
112
|
+
}),
|
|
113
|
+
children: (e) => {
|
|
114
|
+
let t = w(e, o, a, l, r(i) !== void 0);
|
|
115
|
+
return /* @__PURE__ */ S(d, {
|
|
116
|
+
height: o,
|
|
117
|
+
label: _,
|
|
118
|
+
leave: g.clear,
|
|
119
|
+
width: e,
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ x(T, {
|
|
122
|
+
data: a,
|
|
123
|
+
every: i.labelEvery ?? 3,
|
|
124
|
+
formatX: u,
|
|
125
|
+
layout: t
|
|
126
|
+
}),
|
|
127
|
+
a.map((e, n) => /* @__PURE__ */ x(E, {
|
|
128
|
+
bin: e,
|
|
129
|
+
dim: g.dim(n),
|
|
130
|
+
format: f,
|
|
131
|
+
index: n,
|
|
132
|
+
layout: t,
|
|
133
|
+
onHover: g.showAt(n),
|
|
134
|
+
peak: n === h,
|
|
135
|
+
unit: l
|
|
136
|
+
}, e.x0)),
|
|
137
|
+
m !== null && m >= b && m <= O ? /* @__PURE__ */ x(D, {
|
|
138
|
+
label: i.markerLabel ?? `Median · ${u(Math.round(m))}`,
|
|
139
|
+
layout: t,
|
|
140
|
+
value: m
|
|
141
|
+
}) : null,
|
|
142
|
+
/* @__PURE__ */ x(c, {
|
|
143
|
+
height: o,
|
|
144
|
+
text: r(i),
|
|
145
|
+
width: e
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
//#endregion
|
|
153
|
+
export { O as RungHistogram };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/charts/basics/rung-waterfall.data.ts
|
|
3
|
+
var e = [
|
|
4
|
+
{
|
|
5
|
+
label: "Fossil",
|
|
6
|
+
value: 35.9
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
label: "Land use",
|
|
10
|
+
value: 5
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
label: "Emitted",
|
|
14
|
+
total: !0
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: "Ocean",
|
|
18
|
+
value: -11.8
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: "Plants",
|
|
22
|
+
value: -8.7
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "Air",
|
|
26
|
+
total: !0
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
//#endregion
|
|
30
|
+
export { e as rungWaterfallDemo };
|