@howells/hairline 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +148 -2
- package/lib/charts/axes.js +5 -0
- package/lib/charts/basics/candlestick.data.js +44 -0
- package/lib/charts/basics/candlestick.js +180 -0
- package/lib/charts/basics/daily-empty.js +24 -0
- package/lib/charts/basics/daily-readings.js +16 -0
- package/lib/charts/basics/dot-heat.data.js +225 -0
- package/lib/charts/basics/dot-heat.js +174 -0
- package/lib/charts/basics/dumbbell-queue.js +203 -0
- package/lib/charts/basics/hairline-area.js +208 -0
- package/lib/charts/basics/hairline-line.js +195 -0
- package/lib/charts/basics/nested-treemap.data.js +55 -0
- package/lib/charts/basics/nested-treemap.js +191 -0
- package/lib/charts/basics/paired-rungs.data.js +31 -0
- package/lib/charts/basics/paired-rungs.js +151 -0
- package/lib/charts/basics/plumb-scatter.js +229 -0
- package/lib/charts/basics/rung-bars.js +178 -0
- package/lib/charts/basics/rung-geometry.js +6 -0
- package/lib/charts/basics/rung-histogram.data.js +73 -0
- package/lib/charts/basics/rung-histogram.js +153 -0
- package/lib/charts/basics/rung-waterfall.data.js +30 -0
- package/lib/charts/basics/rung-waterfall.js +150 -0
- package/lib/charts/basics/rungs.js +22 -0
- package/lib/charts/basics/series-key.js +26 -0
- package/lib/charts/basics/stacked-rungs.data.js +42 -0
- package/lib/charts/basics/stacked-rungs.js +174 -0
- package/lib/charts/basics/stream-ribbon.data.js +124 -0
- package/lib/charts/basics/stream-ribbon.js +336 -0
- package/lib/charts/basics/tick-box.data.js +50 -0
- package/lib/charts/basics/tick-box.js +226 -0
- package/lib/charts/basics/tick-donut.data.js +30 -0
- package/lib/charts/basics/tick-donut.js +210 -0
- package/lib/charts/basics/tick-gauge.data.js +8 -0
- package/lib/charts/basics/tick-gauge.js +169 -0
- package/lib/charts/basics/tick-rows.data.js +30 -0
- package/lib/charts/basics/tick-rows.js +121 -0
- package/lib/charts/basics/util-a.js +15 -0
- package/lib/charts/basics/util-b.js +13 -0
- package/lib/charts/big/circular-graph.data.js +827 -0
- package/lib/charts/big/circular-graph.js +289 -0
- package/lib/charts/big/force-galaxy-model.js +167 -0
- package/lib/charts/big/force-galaxy.data.js +813 -0
- package/lib/charts/big/force-galaxy.js +276 -0
- package/lib/charts/big/thread-triptych.data.js +204 -0
- package/lib/charts/big/thread-triptych.js +334 -0
- package/lib/charts/board/room.js +6 -0
- package/lib/charts/board/slope.js +176 -0
- package/lib/charts/board/spread.js +28 -0
- package/lib/charts/control.js +18 -0
- package/lib/charts/core.js +84 -0
- package/lib/charts/data-table.js +34 -0
- package/lib/charts/fills.js +153 -0
- package/lib/charts/forms/area-difference.data.js +62 -0
- package/lib/charts/forms/area-difference.js +192 -0
- package/lib/charts/forms/brush-math.js +42 -0
- package/lib/charts/forms/brush-strip.js +199 -0
- package/lib/charts/forms/brushed-overview.data.js +374 -0
- package/lib/charts/forms/brushed-overview.js +162 -0
- package/lib/charts/forms/chord-ring.data.js +140 -0
- package/lib/charts/forms/chord-ring.js +167 -0
- package/lib/charts/forms/circle-pack.data.js +80 -0
- package/lib/charts/forms/circle-pack.js +99 -0
- package/lib/charts/forms/hatched-stack.data.js +71 -0
- package/lib/charts/forms/hatched-stack.js +228 -0
- package/lib/charts/forms/radial-year.data.js +13 -0
- package/lib/charts/forms/radial-year.js +156 -0
- package/lib/charts/frame.js +73 -0
- package/lib/charts/glance/aggregate-sankey.data.js +74 -0
- package/lib/charts/glance/aggregate-sankey.js +242 -0
- package/lib/charts/glance/bar-race.data.js +122 -0
- package/lib/charts/glance/bar-race.js +246 -0
- package/lib/charts/glance/big-slice.data.js +41 -0
- package/lib/charts/glance/big-slice.js +238 -0
- package/lib/charts/glance/chunky-bars.data.js +22 -0
- package/lib/charts/glance/chunky-bars.js +113 -0
- package/lib/charts/glance/circular-graph.data.js +146 -0
- package/lib/charts/glance/circular-graph.js +138 -0
- package/lib/charts/glance/control-slot.js +9 -0
- package/lib/charts/glance/diverging-bar.data.js +34 -0
- package/lib/charts/glance/diverging-bar.js +154 -0
- package/lib/charts/glance/dot-waffle.data.js +26 -0
- package/lib/charts/glance/dot-waffle.js +179 -0
- package/lib/charts/glance/draw-in.data.js +9 -0
- package/lib/charts/glance/draw-in.goals.json.js +289 -0
- package/lib/charts/glance/draw-in.js +214 -0
- package/lib/charts/glance/dynamic-stream.data.js +6 -0
- package/lib/charts/glance/dynamic-stream.js +189 -0
- package/lib/charts/glance/force-graph.data.js +77 -0
- package/lib/charts/glance/force-graph.js +211 -0
- package/lib/charts/glance/jitter-strip.data.js +10 -0
- package/lib/charts/glance/jitter-strip.easter.json.js +430 -0
- package/lib/charts/glance/jitter-strip.js +157 -0
- package/lib/charts/glance/link-bundle.js +51 -0
- package/lib/charts/glance/matrix-heat-glance.data.js +108 -0
- package/lib/charts/glance/matrix-heat-glance.js +170 -0
- package/lib/charts/glance/pictorial-bar.data.js +22 -0
- package/lib/charts/glance/pictorial-bar.js +180 -0
- package/lib/charts/glance/rainfall-dual-area.data.js +177 -0
- package/lib/charts/glance/rainfall-dual-area.js +192 -0
- package/lib/charts/glance/rank-strip.data.js +76 -0
- package/lib/charts/glance/rank-strip.js +172 -0
- package/lib/charts/glance/scatter-labels.js +60 -0
- package/lib/charts/glance/scatter-morph.data.js +78 -0
- package/lib/charts/glance/scatter-morph.js +338 -0
- package/lib/charts/glance/single-axis.data.js +6 -0
- package/lib/charts/glance/single-axis.js +150 -0
- package/lib/charts/glance/single-axis.tides.json.js +180 -0
- package/lib/charts/glance/stagger-wave.data.js +66 -0
- package/lib/charts/glance/stagger-wave.js +132 -0
- package/lib/charts/glance/tree-lr.data.js +41 -0
- package/lib/charts/glance/tree-lr.js +135 -0
- package/lib/charts/glance/util-a.js +49 -0
- package/lib/charts/glance/util-b.js +19 -0
- package/lib/charts/glance/violin.data.js +9 -0
- package/lib/charts/glance/violin.js +185 -0
- package/lib/charts/glance/violin.tenors.json.js +5 -0
- package/lib/charts/hooks.js +154 -0
- package/lib/charts/hover.js +19 -0
- package/lib/charts/lupi/arc-matrix.data.js +83 -0
- package/lib/charts/lupi/arc-matrix.js +146 -0
- package/lib/charts/lupi/ballot-tally.data.js +22 -0
- package/lib/charts/lupi/ballot-tally.js +125 -0
- package/lib/charts/lupi/barcode-lollipop.data.js +195 -0
- package/lib/charts/lupi/barcode-lollipop.js +161 -0
- package/lib/charts/lupi/brand-spectrum.data.js +70 -0
- package/lib/charts/lupi/brand-spectrum.js +233 -0
- package/lib/charts/lupi/bubble-almanac.data.js +689 -0
- package/lib/charts/lupi/bubble-almanac.js +164 -0
- package/lib/charts/lupi/calendar-heat.data.js +399 -0
- package/lib/charts/lupi/calendar-heat.js +175 -0
- package/lib/charts/lupi/cluster-field.data.js +83 -0
- package/lib/charts/lupi/cluster-field.js +173 -0
- package/lib/charts/lupi/dot-cascade.data.js +54 -0
- package/lib/charts/lupi/dot-cascade.js +124 -0
- package/lib/charts/lupi/dotty-matrix.data.js +170 -0
- package/lib/charts/lupi/dotty-matrix.js +126 -0
- package/lib/charts/lupi/hourglass-stream.data.js +30 -0
- package/lib/charts/lupi/hourglass-stream.js +158 -0
- package/lib/charts/lupi/hundred-field.data.js +38 -0
- package/lib/charts/lupi/hundred-field.js +237 -0
- package/lib/charts/lupi/launch-fan.data.js +315 -0
- package/lib/charts/lupi/launch-fan.js +198 -0
- package/lib/charts/lupi/matrix-heat.data.js +97 -0
- package/lib/charts/lupi/matrix-heat.js +246 -0
- package/lib/charts/lupi/parallel-coordinates.data.js +54 -0
- package/lib/charts/lupi/parallel-coordinates.js +218 -0
- package/lib/charts/lupi/radial-convergence.data.js +178 -0
- package/lib/charts/lupi/radial-convergence.js +208 -0
- package/lib/charts/lupi/radial-patchwork.data.js +454 -0
- package/lib/charts/lupi/radial-patchwork.js +181 -0
- package/lib/charts/lupi/ridgeline.data.js +1834 -0
- package/lib/charts/lupi/ridgeline.js +195 -0
- package/lib/charts/lupi/trend-lineage.data.js +51 -0
- package/lib/charts/lupi/trend-lineage.js +198 -0
- package/lib/charts/lupi/type-colonnade.data.js +18 -0
- package/lib/charts/lupi/type-colonnade.js +198 -0
- package/lib/charts/lupi/util-a.js +14 -0
- package/lib/charts/lupi/util-b.js +12 -0
- package/lib/charts/maps/choropleth.js +295 -0
- package/lib/charts/maps/geo.js +84 -0
- package/lib/charts/maps/legend.js +83 -0
- package/lib/charts/maps/step-fill.js +9 -0
- package/lib/charts/maps/us-choropleth.data.js +249 -0
- package/lib/charts/maps/us-choropleth.js +41 -0
- package/lib/charts/maps/world-choropleth.data.js +681 -0
- package/lib/charts/maps/world-choropleth.js +46 -0
- package/lib/charts/markers.js +35 -0
- package/lib/charts/marks.js +31 -0
- package/lib/charts/motion.js +11 -0
- package/lib/charts/originals/daily-users.data.js +101 -0
- package/lib/charts/originals/daily-users.js +203 -0
- package/lib/charts/originals/feature-rank.data.js +92 -0
- package/lib/charts/originals/feature-rank.js +167 -0
- package/lib/charts/originals/format.js +5 -0
- package/lib/charts/originals/key.js +26 -0
- package/lib/charts/originals/response-time.data.js +98 -0
- package/lib/charts/originals/response-time.js +187 -0
- package/lib/charts/originals/revenue-by-plan.data.js +26 -0
- package/lib/charts/originals/revenue-by-plan.js +248 -0
- package/lib/charts/playback.js +68 -0
- package/lib/charts/plot-note.js +27 -0
- package/lib/charts/roles.js +5 -0
- package/lib/charts/rules.js +66 -0
- package/lib/charts/scale-context.js +6 -0
- package/lib/charts/shapes.js +8 -0
- package/lib/charts/shared-options.js +25 -0
- package/lib/charts/svg.js +43 -0
- package/lib/charts/text.js +30 -0
- package/lib/charts/texture-ids.js +20 -0
- package/lib/charts/texture.js +286 -0
- package/lib/charts/util.js +43 -0
- package/lib/charts/value-grid.js +26 -0
- package/lib/draw.js +27 -0
- package/lib/entries/dumbbell-queue.js +2 -0
- package/lib/entries/hairline-area.js +2 -0
- package/lib/entries/hairline-line.js +2 -0
- package/lib/entries/plumb-scatter.js +2 -0
- package/lib/entries/rung-bars.js +2 -0
- package/lib/entries/slope.js +2 -0
- package/lib/frame.js +2 -0
- package/lib/hairline.css +1385 -0
- package/lib/index.js +72 -0
- package/lib/json-schema/dumbbell-queue.json +258 -0
- package/lib/json-schema/hairline-area.json +262 -0
- package/lib/json-schema/hairline-line.json +256 -0
- package/lib/json-schema/index.json +50 -0
- package/lib/json-schema/plumb-scatter.json +363 -0
- package/lib/json-schema/rung-bars.json +230 -0
- package/lib/json-schema/slope.json +333 -0
- package/lib/kit.js +16 -0
- package/lib/lib/format.js +29 -0
- package/lib/lib/random.js +8 -0
- package/lib/maps.js +4 -0
- package/lib/schema/daily.js +9 -0
- package/lib/schema/dumbbell-queue.js +28 -0
- package/lib/schema/format.js +72 -0
- package/lib/schema/hairline-area.js +24 -0
- package/lib/schema/hairline-line.js +23 -0
- package/lib/schema/key.js +4 -0
- package/lib/schema/metrics.js +26 -0
- package/lib/schema/motion.js +12 -0
- package/lib/schema/options.js +21 -0
- package/lib/schema/plumb-scatter.js +48 -0
- package/lib/schema/registry.js +132 -0
- package/lib/schema/rung-bars.js +25 -0
- package/lib/schema/scale.js +9 -0
- package/lib/schema/slope.js +28 -0
- package/lib/schema/validate.js +25 -0
- package/lib/schema.js +16 -0
- package/lib/theme/derive.js +98 -0
- package/lib/theme.css +443 -0
- package/lib/theme.js +1 -0
- package/lib/tokens.css +306 -0
- package/lib/types/charts/axes.d.ts +14 -0
- package/lib/types/charts/basics/candlestick.d.ts +22 -0
- package/lib/types/charts/basics/candlestick.data.d.ts +10 -0
- package/lib/types/charts/basics/daily-empty.d.ts +7 -0
- package/lib/types/charts/basics/daily-readings.d.ts +38 -0
- package/lib/types/charts/basics/dot-heat.d.ts +19 -0
- package/lib/types/charts/basics/dot-heat.data.d.ts +28 -0
- package/lib/types/charts/basics/dumbbell-queue.d.ts +15 -0
- package/lib/types/charts/basics/hairline-area.d.ts +18 -0
- package/lib/types/charts/basics/hairline-line.d.ts +18 -0
- package/lib/types/charts/basics/nested-treemap.d.ts +18 -0
- package/lib/types/charts/basics/nested-treemap.data.d.ts +30 -0
- package/lib/types/charts/basics/paired-rungs.d.ts +21 -0
- package/lib/types/charts/basics/paired-rungs.data.d.ts +43 -0
- package/lib/types/charts/basics/plumb-scatter.d.ts +14 -0
- package/lib/types/charts/basics/rung-bars.d.ts +16 -0
- package/lib/types/charts/basics/rung-geometry.d.ts +6 -0
- package/lib/types/charts/basics/rung-histogram.d.ts +22 -0
- package/lib/types/charts/basics/rung-histogram.data.d.ts +34 -0
- package/lib/types/charts/basics/rung-waterfall.d.ts +19 -0
- package/lib/types/charts/basics/rung-waterfall.data.d.ts +31 -0
- package/lib/types/charts/basics/rungs.d.ts +28 -0
- package/lib/types/charts/basics/series-key.d.ts +19 -0
- package/lib/types/charts/basics/stacked-rungs.d.ts +20 -0
- package/lib/types/charts/basics/stacked-rungs.data.d.ts +26 -0
- package/lib/types/charts/basics/stream-ribbon.d.ts +19 -0
- package/lib/types/charts/basics/stream-ribbon.data.d.ts +29 -0
- package/lib/types/charts/basics/tick-box.d.ts +19 -0
- package/lib/types/charts/basics/tick-box.data.d.ts +30 -0
- package/lib/types/charts/basics/tick-donut.d.ts +24 -0
- package/lib/types/charts/basics/tick-donut.data.d.ts +25 -0
- package/lib/types/charts/basics/tick-gauge.d.ts +22 -0
- package/lib/types/charts/basics/tick-gauge.data.d.ts +24 -0
- package/lib/types/charts/basics/tick-rows.d.ts +18 -0
- package/lib/types/charts/basics/tick-rows.data.d.ts +23 -0
- package/lib/types/charts/basics/util-a.d.ts +10 -0
- package/lib/types/charts/basics/util-b.d.ts +13 -0
- package/lib/types/charts/big/circular-graph.d.ts +20 -0
- package/lib/types/charts/big/circular-graph.data.d.ts +46 -0
- package/lib/types/charts/big/force-galaxy-model.d.ts +109 -0
- package/lib/types/charts/big/force-galaxy.d.ts +18 -0
- package/lib/types/charts/big/force-galaxy.data.d.ts +48 -0
- package/lib/types/charts/big/thread-triptych.d.ts +17 -0
- package/lib/types/charts/big/thread-triptych.data.d.ts +41 -0
- package/lib/types/charts/board/room.d.ts +18 -0
- package/lib/types/charts/board/slope.d.ts +14 -0
- package/lib/types/charts/board/spread.d.ts +5 -0
- package/lib/types/charts/control.d.ts +17 -0
- package/lib/types/charts/core.d.ts +77 -0
- package/lib/types/charts/data-table.d.ts +18 -0
- package/lib/types/charts/fills.d.ts +103 -0
- package/lib/types/charts/forms/area-difference.d.ts +9 -0
- package/lib/types/charts/forms/area-difference.data.d.ts +26 -0
- package/lib/types/charts/forms/brush-math.d.ts +19 -0
- package/lib/types/charts/forms/brush-strip.d.ts +19 -0
- package/lib/types/charts/forms/brushed-overview.d.ts +12 -0
- package/lib/types/charts/forms/brushed-overview.data.d.ts +16 -0
- package/lib/types/charts/forms/chord-ring.d.ts +12 -0
- package/lib/types/charts/forms/chord-ring.data.d.ts +29 -0
- package/lib/types/charts/forms/circle-pack.d.ts +9 -0
- package/lib/types/charts/forms/circle-pack.data.d.ts +23 -0
- package/lib/types/charts/forms/hatched-stack.d.ts +10 -0
- package/lib/types/charts/forms/hatched-stack.data.d.ts +36 -0
- package/lib/types/charts/forms/radial-year.d.ts +8 -0
- package/lib/types/charts/forms/radial-year.data.d.ts +17 -0
- package/lib/types/charts/frame.d.ts +21 -0
- package/lib/types/charts/glance/aggregate-sankey.d.ts +23 -0
- package/lib/types/charts/glance/aggregate-sankey.data.d.ts +32 -0
- package/lib/types/charts/glance/bar-race.d.ts +20 -0
- package/lib/types/charts/glance/bar-race.data.d.ts +32 -0
- package/lib/types/charts/glance/big-slice.d.ts +27 -0
- package/lib/types/charts/glance/big-slice.data.d.ts +30 -0
- package/lib/types/charts/glance/chunky-bars.d.ts +18 -0
- package/lib/types/charts/glance/chunky-bars.data.d.ts +24 -0
- package/lib/types/charts/glance/circular-graph.d.ts +19 -0
- package/lib/types/charts/glance/circular-graph.data.d.ts +43 -0
- package/lib/types/charts/glance/control-slot.d.ts +9 -0
- package/lib/types/charts/glance/diverging-bar.d.ts +19 -0
- package/lib/types/charts/glance/diverging-bar.data.d.ts +27 -0
- package/lib/types/charts/glance/dot-waffle.d.ts +19 -0
- package/lib/types/charts/glance/dot-waffle.data.d.ts +31 -0
- package/lib/types/charts/glance/draw-in.d.ts +20 -0
- package/lib/types/charts/glance/draw-in.data.d.ts +6 -0
- package/lib/types/charts/glance/dynamic-stream.d.ts +22 -0
- package/lib/types/charts/glance/dynamic-stream.data.d.ts +7 -0
- package/lib/types/charts/glance/force-graph.d.ts +16 -0
- package/lib/types/charts/glance/force-graph.data.d.ts +45 -0
- package/lib/types/charts/glance/jitter-strip.d.ts +24 -0
- package/lib/types/charts/glance/jitter-strip.data.d.ts +27 -0
- package/lib/types/charts/glance/link-bundle.d.ts +22 -0
- package/lib/types/charts/glance/matrix-heat-glance.d.ts +22 -0
- package/lib/types/charts/glance/matrix-heat-glance.data.d.ts +35 -0
- package/lib/types/charts/glance/pictorial-bar.d.ts +20 -0
- package/lib/types/charts/glance/pictorial-bar.data.d.ts +27 -0
- package/lib/types/charts/glance/rainfall-dual-area.d.ts +19 -0
- package/lib/types/charts/glance/rainfall-dual-area.data.d.ts +32 -0
- package/lib/types/charts/glance/rank-strip.d.ts +19 -0
- package/lib/types/charts/glance/rank-strip.data.d.ts +36 -0
- package/lib/types/charts/glance/scatter-labels.d.ts +23 -0
- package/lib/types/charts/glance/scatter-morph.d.ts +22 -0
- package/lib/types/charts/glance/scatter-morph.data.d.ts +30 -0
- package/lib/types/charts/glance/single-axis.d.ts +27 -0
- package/lib/types/charts/glance/single-axis.data.d.ts +6 -0
- package/lib/types/charts/glance/stagger-wave.d.ts +18 -0
- package/lib/types/charts/glance/stagger-wave.data.d.ts +26 -0
- package/lib/types/charts/glance/tree-lr.d.ts +16 -0
- package/lib/types/charts/glance/tree-lr.data.d.ts +27 -0
- package/lib/types/charts/glance/util-a.d.ts +31 -0
- package/lib/types/charts/glance/util-b.d.ts +12 -0
- package/lib/types/charts/glance/violin.d.ts +22 -0
- package/lib/types/charts/glance/violin.data.d.ts +24 -0
- package/lib/types/charts/hooks.d.ts +109 -0
- package/lib/types/charts/hover.d.ts +26 -0
- package/lib/types/charts/lupi/arc-matrix.d.ts +18 -0
- package/lib/types/charts/lupi/arc-matrix.data.d.ts +28 -0
- package/lib/types/charts/lupi/ballot-tally.d.ts +19 -0
- package/lib/types/charts/lupi/ballot-tally.data.d.ts +28 -0
- package/lib/types/charts/lupi/barcode-lollipop.d.ts +19 -0
- package/lib/types/charts/lupi/barcode-lollipop.data.d.ts +26 -0
- package/lib/types/charts/lupi/brand-spectrum.d.ts +28 -0
- package/lib/types/charts/lupi/brand-spectrum.data.d.ts +34 -0
- package/lib/types/charts/lupi/bubble-almanac.d.ts +22 -0
- package/lib/types/charts/lupi/bubble-almanac.data.d.ts +45 -0
- package/lib/types/charts/lupi/calendar-heat.d.ts +19 -0
- package/lib/types/charts/lupi/calendar-heat.data.d.ts +20 -0
- package/lib/types/charts/lupi/cluster-field.d.ts +21 -0
- package/lib/types/charts/lupi/cluster-field.data.d.ts +52 -0
- package/lib/types/charts/lupi/dot-cascade.d.ts +22 -0
- package/lib/types/charts/lupi/dot-cascade.data.d.ts +24 -0
- package/lib/types/charts/lupi/dotty-matrix.d.ts +17 -0
- package/lib/types/charts/lupi/dotty-matrix.data.d.ts +32 -0
- package/lib/types/charts/lupi/hourglass-stream.d.ts +18 -0
- package/lib/types/charts/lupi/hourglass-stream.data.d.ts +27 -0
- package/lib/types/charts/lupi/hundred-field.d.ts +18 -0
- package/lib/types/charts/lupi/hundred-field.data.d.ts +24 -0
- package/lib/types/charts/lupi/launch-fan.d.ts +37 -0
- package/lib/types/charts/lupi/launch-fan.data.d.ts +41 -0
- package/lib/types/charts/lupi/matrix-heat.d.ts +20 -0
- package/lib/types/charts/lupi/matrix-heat.data.d.ts +29 -0
- package/lib/types/charts/lupi/parallel-coordinates.d.ts +23 -0
- package/lib/types/charts/lupi/parallel-coordinates.data.d.ts +40 -0
- package/lib/types/charts/lupi/radial-convergence.d.ts +15 -0
- package/lib/types/charts/lupi/radial-convergence.data.d.ts +24 -0
- package/lib/types/charts/lupi/radial-patchwork.d.ts +16 -0
- package/lib/types/charts/lupi/radial-patchwork.data.d.ts +35 -0
- package/lib/types/charts/lupi/ridgeline.d.ts +23 -0
- package/lib/types/charts/lupi/ridgeline.data.d.ts +19 -0
- package/lib/types/charts/lupi/trend-lineage.d.ts +18 -0
- package/lib/types/charts/lupi/trend-lineage.data.d.ts +56 -0
- package/lib/types/charts/lupi/type-colonnade.d.ts +20 -0
- package/lib/types/charts/lupi/type-colonnade.data.d.ts +30 -0
- package/lib/types/charts/lupi/util-a.d.ts +9 -0
- package/lib/types/charts/lupi/util-b.d.ts +11 -0
- package/lib/types/charts/maps/choropleth.d.ts +33 -0
- package/lib/types/charts/maps/geo.d.ts +48 -0
- package/lib/types/charts/maps/legend.d.ts +14 -0
- package/lib/types/charts/maps/step-fill.d.ts +6 -0
- package/lib/types/charts/maps/us-choropleth.d.ts +25 -0
- package/lib/types/charts/maps/us-choropleth.data.d.ts +23 -0
- package/lib/types/charts/maps/world-choropleth.d.ts +22 -0
- package/lib/types/charts/maps/world-choropleth.data.d.ts +35 -0
- package/lib/types/charts/markers.d.ts +42 -0
- package/lib/types/charts/marks.d.ts +58 -0
- package/lib/types/charts/motion.d.ts +12 -0
- package/lib/types/charts/originals/daily-users.d.ts +13 -0
- package/lib/types/charts/originals/daily-users.data.d.ts +17 -0
- package/lib/types/charts/originals/feature-rank.d.ts +13 -0
- package/lib/types/charts/originals/feature-rank.data.d.ts +29 -0
- package/lib/types/charts/originals/format.d.ts +2 -0
- package/lib/types/charts/originals/key.d.ts +16 -0
- package/lib/types/charts/originals/response-time.d.ts +11 -0
- package/lib/types/charts/originals/response-time.data.d.ts +24 -0
- package/lib/types/charts/originals/revenue-by-plan.d.ts +12 -0
- package/lib/types/charts/originals/revenue-by-plan.data.d.ts +26 -0
- package/lib/types/charts/playback.d.ts +42 -0
- package/lib/types/charts/plot-note.d.ts +37 -0
- package/lib/types/charts/roles.d.ts +28 -0
- package/lib/types/charts/rules.d.ts +62 -0
- package/lib/types/charts/scale-context.d.ts +3 -0
- package/lib/types/charts/shapes.d.ts +9 -0
- package/lib/types/charts/shared-options.d.ts +25 -0
- package/lib/types/charts/svg.d.ts +24 -0
- package/lib/types/charts/text.d.ts +36 -0
- package/lib/types/charts/texture-ids.d.ts +24 -0
- package/lib/types/charts/texture.d.ts +185 -0
- package/lib/types/charts/util.d.ts +66 -0
- package/lib/types/charts/value-grid.d.ts +22 -0
- package/lib/types/draw.d.ts +279 -0
- package/lib/types/entries/dumbbell-queue.d.ts +2 -0
- package/lib/types/entries/hairline-area.d.ts +2 -0
- package/lib/types/entries/hairline-line.d.ts +2 -0
- package/lib/types/entries/plumb-scatter.d.ts +2 -0
- package/lib/types/entries/rung-bars.d.ts +2 -0
- package/lib/types/entries/slope.d.ts +2 -0
- package/lib/types/frame.d.ts +2 -0
- package/lib/types/index.d.ts +82 -0
- package/lib/types/kit.d.ts +22 -0
- package/lib/types/lib/format.d.ts +58 -0
- package/lib/types/lib/random.d.ts +5 -0
- package/lib/types/maps.d.ts +2 -0
- package/lib/types/schema/daily.d.ts +14 -0
- package/lib/types/schema/dumbbell-queue.d.ts +91 -0
- package/lib/types/schema/format.d.ts +101 -0
- package/lib/types/schema/hairline-area.d.ts +83 -0
- package/lib/types/schema/hairline-line.d.ts +85 -0
- package/lib/types/schema/key.d.ts +12 -0
- package/lib/types/schema/metrics.d.ts +26 -0
- package/lib/types/schema/motion.d.ts +22 -0
- package/lib/types/schema/options.d.ts +51 -0
- package/lib/types/schema/plumb-scatter.d.ts +124 -0
- package/lib/types/schema/registry.d.ts +309 -0
- package/lib/types/schema/rung-bars.d.ts +84 -0
- package/lib/types/schema/scale.d.ts +36 -0
- package/lib/types/schema/slope.d.ts +120 -0
- package/lib/types/schema/validate.d.ts +29 -0
- package/lib/types/schema.d.ts +30 -0
- package/lib/types/theme/derive.d.ts +23 -0
- package/lib/types/theme.d.ts +2 -0
- package/lib/vendor/us-atlas/states-10m.json.js +13855 -0
- package/lib/vendor/world-atlas/countries-110m.json.js +9357 -0
- package/package.json +160 -3
|
@@ -0,0 +1,174 @@
|
|
|
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 } from "../hover.js";
|
|
6
|
+
import { RING_STEP as s } from "../marks.js";
|
|
7
|
+
import { FootNote as c } from "../plot-note.js";
|
|
8
|
+
import { ChartSvg as l } from "../svg.js";
|
|
9
|
+
import { Label as u } from "../text.js";
|
|
10
|
+
import { inkWidth as d } from "./util-b.js";
|
|
11
|
+
import { DotRing as f } from "../texture.js";
|
|
12
|
+
import { dotHeatDemo as p } from "./dot-heat.data.js";
|
|
13
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
14
|
+
//#region src/charts/basics/dot-heat.tsx
|
|
15
|
+
var g = 2.5, _ = .75, v = 4, y = (e, t, n, r) => {
|
|
16
|
+
let i = e.radius(t[n]?.[r] ?? 0), a = i + v;
|
|
17
|
+
for (let i of [
|
|
18
|
+
-1,
|
|
19
|
+
0,
|
|
20
|
+
1
|
|
21
|
+
]) for (let o of [
|
|
22
|
+
-1,
|
|
23
|
+
0,
|
|
24
|
+
1
|
|
25
|
+
]) {
|
|
26
|
+
let s = t[n + i]?.[r + o];
|
|
27
|
+
if ((i !== 0 || o !== 0) && s !== void 0 && s > 0) {
|
|
28
|
+
let t = Math.hypot(i * e.rowH, o * e.colW);
|
|
29
|
+
a = Math.min(a, t - e.radius(s) - g - _);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return Math.max(i + g + _, a);
|
|
33
|
+
}, b = (e, t) => t.hi > t.lo ? (e - t.lo) / (t.hi - t.lo) : 1, x = (e, t, n) => {
|
|
34
|
+
if (n) return "fill-hero";
|
|
35
|
+
if (e <= 0) return "fill-l5";
|
|
36
|
+
let r = b(e, t);
|
|
37
|
+
return r >= 2 / 3 ? "fill-l2" : r >= 1 / 3 ? "fill-l3" : "fill-l4";
|
|
38
|
+
}, S = 14, C = 2, w = (e, t, n) => e <= 0 ? 1 : Math.sqrt(C ** 2 + b(e, t) * (n ** 2 - C ** 2)), T = (e) => Math.min(e * .44, (e - g * 2 - _ * 2) / 2), E = (e, t, n, r, i, a) => {
|
|
39
|
+
let o = i ? 62 : 34, s = n.columns.length, c = n.values.map((e) => e[s - 1] ?? 0), l = d(n.columns[s - 1] ?? "") / 2, u = (t) => {
|
|
40
|
+
let i = S + Math.max(...n.rows.map((e) => d(t ? e.slice(0, 2) : e))), o = (e) => Math.max(w(Math.max(...c), r, T(e)), (s - 1) % (t ? a * 2 : a) == 0 ? l : 0), u = (e - i - 4) / s;
|
|
41
|
+
for (let t = 0; t < 4; t += 1) u = (e - i - 4 - o(u)) / (s - .5);
|
|
42
|
+
return {
|
|
43
|
+
colRoom: u,
|
|
44
|
+
labelW: i,
|
|
45
|
+
reach: o
|
|
46
|
+
};
|
|
47
|
+
}, f = !1, p = u(!1);
|
|
48
|
+
Math.min(p.colRoom, 58) < 34 && (f = !0, p = u(!0));
|
|
49
|
+
let { colRoom: m, labelW: h } = p, g = Math.min((t - 40 - o) / n.rows.length, m * 1.15), _ = g * n.rows.length, v = Math.min(m, g * 1.05, 58), y = (e - h - (s - .5) * v - p.reach(v)) / 2 + h, b = Math.min(v, g), x = T(b);
|
|
50
|
+
return {
|
|
51
|
+
cell: b,
|
|
52
|
+
colW: v,
|
|
53
|
+
cx: (e) => y + (e + .5) * v,
|
|
54
|
+
cy: (e) => 40 + (e + .5) * g,
|
|
55
|
+
gridBottom: 40 + _,
|
|
56
|
+
height: Math.round(40 + _ + o),
|
|
57
|
+
narrow: f,
|
|
58
|
+
radius: (e) => w(e, r, x),
|
|
59
|
+
rowH: g,
|
|
60
|
+
top: 40,
|
|
61
|
+
x0: y
|
|
62
|
+
};
|
|
63
|
+
}, D = (e) => {
|
|
64
|
+
let [t] = e;
|
|
65
|
+
for (let n of e) (t === void 0 || n.v > t.v) && (t = n);
|
|
66
|
+
return t === void 0 ? [0, 0] : [t.r, t.c];
|
|
67
|
+
}, O = (e) => {
|
|
68
|
+
let { grid: t } = e, n = t.narrow ? e.every * 2 : e.every;
|
|
69
|
+
return /* @__PURE__ */ h("g", { children: [e.data.rows.map((e, n) => /* @__PURE__ */ m(u, {
|
|
70
|
+
anchor: "end",
|
|
71
|
+
middle: !0,
|
|
72
|
+
muted: !0,
|
|
73
|
+
voice: "label",
|
|
74
|
+
x: t.x0 - S,
|
|
75
|
+
y: t.cy(n),
|
|
76
|
+
children: t.narrow ? e.slice(0, 2) : e
|
|
77
|
+
}, e)), e.data.columns.map((e, r) => r % n === 0 ? /* @__PURE__ */ m(u, {
|
|
78
|
+
anchor: "middle",
|
|
79
|
+
voice: "axis",
|
|
80
|
+
x: t.cx(r),
|
|
81
|
+
y: t.gridBottom + 18,
|
|
82
|
+
children: e
|
|
83
|
+
}, e) : null)] });
|
|
84
|
+
}, k = (e) => {
|
|
85
|
+
let { grid: t } = e;
|
|
86
|
+
return /* @__PURE__ */ m("g", { children: e.cells.map((n, r) => /* @__PURE__ */ h(a, {
|
|
87
|
+
dim: e.dim(r),
|
|
88
|
+
onPointerEnter: () => {
|
|
89
|
+
e.onHover(r, t.cx(n.c), t.top - 2);
|
|
90
|
+
},
|
|
91
|
+
children: [/* @__PURE__ */ m("circle", {
|
|
92
|
+
className: `pop ${x(n.v, e.span, n.id === e.hero)}`,
|
|
93
|
+
cx: t.cx(n.c),
|
|
94
|
+
cy: t.cy(n.r),
|
|
95
|
+
r: t.radius(n.v),
|
|
96
|
+
style: i(n.r + n.c, "mark")
|
|
97
|
+
}), /* @__PURE__ */ m(o, {
|
|
98
|
+
height: t.rowH,
|
|
99
|
+
width: t.colW,
|
|
100
|
+
x: t.cx(n.c) - t.colW / 2,
|
|
101
|
+
y: t.cy(n.r) - t.rowH / 2
|
|
102
|
+
})]
|
|
103
|
+
}, n.id)) });
|
|
104
|
+
}, A = (i) => {
|
|
105
|
+
let a = i.data ?? p, o = i.height ?? 460, u = i.format ?? String, d = e(), g = a.values.flatMap((e, t) => e.map((e, n) => ({
|
|
106
|
+
c: n,
|
|
107
|
+
id: `${a.rows[t]}-${a.columns[n]}`,
|
|
108
|
+
r: t,
|
|
109
|
+
v: e
|
|
110
|
+
}))), _ = g.flatMap((e) => e.v > 0 ? [e.v] : []), v = _.length === 0 ? {
|
|
111
|
+
hi: 1,
|
|
112
|
+
lo: 1
|
|
113
|
+
} : {
|
|
114
|
+
hi: Math.max(..._),
|
|
115
|
+
lo: Math.min(..._)
|
|
116
|
+
}, [b, x] = i.highlight ?? D(g), S = a.values[b]?.[x] ?? 0, C = `${a.rows[b]}-${a.columns[x]}`, w = `Values by ${a.rows.length} rows by ${a.columns.length} columns; peak ${u(S)} at ${a.rows[b]} ${a.columns[x]}`;
|
|
117
|
+
return /* @__PURE__ */ m(t, {
|
|
118
|
+
overlay: d.at === null ? null : /* @__PURE__ */ h(n, {
|
|
119
|
+
x: d.at.x,
|
|
120
|
+
y: d.at.y,
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ h("b", { children: [
|
|
123
|
+
a.rows[g[d.at.key].r],
|
|
124
|
+
" ",
|
|
125
|
+
a.columns[g[d.at.key].c]
|
|
126
|
+
] }),
|
|
127
|
+
" ",
|
|
128
|
+
"· ",
|
|
129
|
+
u(g[d.at.key].v)
|
|
130
|
+
]
|
|
131
|
+
}),
|
|
132
|
+
children: (e) => {
|
|
133
|
+
let t = E(e, o, a, v, r(i) !== void 0, i.labelEvery ?? 2);
|
|
134
|
+
return /* @__PURE__ */ h(l, {
|
|
135
|
+
height: t.height,
|
|
136
|
+
label: w,
|
|
137
|
+
leave: d.clear,
|
|
138
|
+
width: e,
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ m(O, {
|
|
141
|
+
data: a,
|
|
142
|
+
every: i.labelEvery ?? 2,
|
|
143
|
+
grid: t
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ m(k, {
|
|
146
|
+
cells: g,
|
|
147
|
+
grid: t,
|
|
148
|
+
dim: d.dim,
|
|
149
|
+
hero: C,
|
|
150
|
+
span: v,
|
|
151
|
+
onHover: (e, t, n) => {
|
|
152
|
+
d.show(e, t, n);
|
|
153
|
+
}
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ m(f, {
|
|
156
|
+
className: "fade pointer-events-none",
|
|
157
|
+
tone: "fill-l2",
|
|
158
|
+
cx: t.cx(x),
|
|
159
|
+
cy: t.cy(b),
|
|
160
|
+
r: y(t, a.values, b, x),
|
|
161
|
+
step: s.mark
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ m(c, {
|
|
164
|
+
height: t.height,
|
|
165
|
+
text: r(i),
|
|
166
|
+
width: e
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
export { A as DotHeat };
|
|
@@ -0,0 +1,203 @@
|
|
|
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, stagger as c } from "../util.js";
|
|
8
|
+
import { DimGroup as l, HitRect as u, TipText as d } from "../hover.js";
|
|
9
|
+
import { DOT as f } from "../marks.js";
|
|
10
|
+
import { Dot as p, Ring as m } from "../markers.js";
|
|
11
|
+
import { FootNote as h } from "../plot-note.js";
|
|
12
|
+
import { HRule as g } from "../rules.js";
|
|
13
|
+
import { chartTable as _, plotOptions as v, scoped as y } from "../shared-options.js";
|
|
14
|
+
import { ChartSvg as b } from "../svg.js";
|
|
15
|
+
import { Label as x } from "../text.js";
|
|
16
|
+
import { inkWidth as S, maxIndex as C } from "./util-b.js";
|
|
17
|
+
import { scaleLinear as w } from "d3-scale";
|
|
18
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
19
|
+
//#region src/charts/basics/dumbbell-queue.tsx
|
|
20
|
+
var D = 2, O = (e, t, n, r) => {
|
|
21
|
+
let i = e.after <= e.before ? t(e.before) : t(e.after);
|
|
22
|
+
return n + 2 + S(i, r);
|
|
23
|
+
}, k = (e, t, n, r, i, a) => {
|
|
24
|
+
let o = Math.max(0, ...n.map((e) => S(e.label, a))), s = D + Math.min(e * .32, Math.ceil(o)), c = r ? 74 : 44, l = n.flatMap((e) => [e.before, e.after]), u = Math.min(0, ...l) * 1.04, d = Math.max(0, ...l) * 1.04, p = d > u ? d - u : 1, m = e < 420 ? "md" : "lg", h = f[m], g = s + 12, _ = Math.min(e - D, ...n.map((t) => {
|
|
25
|
+
let n = (Math.max(t.before, t.after) - u) / p;
|
|
26
|
+
return n > 0 ? g + (e - D - O(t, i, h, a) - g) / n : Infinity;
|
|
27
|
+
})), v = Math.max(g, _);
|
|
28
|
+
return {
|
|
29
|
+
dotR: h,
|
|
30
|
+
dotSize: m,
|
|
31
|
+
labelW: s,
|
|
32
|
+
pitch: (t - 36 - c) / Math.max(1, n.length - 1),
|
|
33
|
+
top: 36,
|
|
34
|
+
x: w().domain([u, u + p]).range([g, v])
|
|
35
|
+
};
|
|
36
|
+
}, A = 8, j = (e) => {
|
|
37
|
+
let { datum: t, layout: n } = e, r = n.x(t.after), i = n.x(t.before), a = Math.sign(r - i), o = i + a * (n.dotR + 3), s = r - a * (n.dotR + 3), l = Math.round(Math.abs(t.before - t.after) / e.unit), u = e.alert === "rise" ? t.after > t.before : t.after < t.before, d = Array.from({ length: l }, (e, n) => ({
|
|
38
|
+
id: `${t.label}-rung-${n}`,
|
|
39
|
+
k: n,
|
|
40
|
+
x: Math.round(o + (n + .5) / l * (s - o)) - 1
|
|
41
|
+
}));
|
|
42
|
+
return /* @__PURE__ */ T("g", {
|
|
43
|
+
className: u ? "fill-alert" : "fill-l4",
|
|
44
|
+
children: d.map((t) => /* @__PURE__ */ T("rect", {
|
|
45
|
+
className: !u && (t.k + 1) % 5 == 0 ? "grow-y fill-l2" : "grow-y",
|
|
46
|
+
height: A,
|
|
47
|
+
style: c(e.index * 3 + t.k * .6, "mark"),
|
|
48
|
+
width: 2,
|
|
49
|
+
x: t.x,
|
|
50
|
+
y: e.y - A / 2
|
|
51
|
+
}, t.id))
|
|
52
|
+
});
|
|
53
|
+
}, M = (e) => {
|
|
54
|
+
let { datum: t, layout: n } = e, r = Math.round(n.top + e.index * n.pitch), i = n.x(t.after), a = n.x(t.before), o = i <= a, s = n.dotR, d = Math.round(Math.abs(t.before - t.after) / e.unit);
|
|
55
|
+
return /* @__PURE__ */ E(l, {
|
|
56
|
+
dim: e.dim,
|
|
57
|
+
onPointerEnter: () => {
|
|
58
|
+
e.onHover((i + a) / 2, r - 16);
|
|
59
|
+
},
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ T(u, {
|
|
62
|
+
height: n.pitch,
|
|
63
|
+
width: e.width,
|
|
64
|
+
x: 0,
|
|
65
|
+
y: r - n.pitch / 2
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ T(g, {
|
|
68
|
+
kind: "rule",
|
|
69
|
+
x0: Math.round(n.x(0)),
|
|
70
|
+
x1: Math.round(n.x.range()[1]),
|
|
71
|
+
y: r
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ T(x, {
|
|
74
|
+
anchor: "end",
|
|
75
|
+
middle: !0,
|
|
76
|
+
muted: !0,
|
|
77
|
+
voice: "label",
|
|
78
|
+
x: n.labelW,
|
|
79
|
+
y: r,
|
|
80
|
+
children: t.label
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ T(j, {
|
|
83
|
+
alert: e.alert,
|
|
84
|
+
datum: t,
|
|
85
|
+
index: e.index,
|
|
86
|
+
layout: n,
|
|
87
|
+
unit: e.unit,
|
|
88
|
+
y: r
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ T(m, {
|
|
91
|
+
className: "pop stroke-l3",
|
|
92
|
+
cx: a,
|
|
93
|
+
cy: r + .5,
|
|
94
|
+
size: n.dotSize,
|
|
95
|
+
style: c(e.index * 3, "mark")
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ T(p, {
|
|
98
|
+
className: e.hero ? "pop fill-hero" : "pop fill-l3",
|
|
99
|
+
cx: i,
|
|
100
|
+
cy: r + .5,
|
|
101
|
+
size: n.dotSize,
|
|
102
|
+
style: c(e.index * 3 + d * .6, "mark")
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ T(x, {
|
|
105
|
+
anchor: o ? "end" : "start",
|
|
106
|
+
order: e.index + 4,
|
|
107
|
+
tier: "mark",
|
|
108
|
+
voice: "value",
|
|
109
|
+
x: i + (o ? -s - 2 : s + 2),
|
|
110
|
+
y: r - 12,
|
|
111
|
+
children: e.format(t.after)
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ T(x, {
|
|
114
|
+
anchor: o ? "start" : "end",
|
|
115
|
+
order: e.index + 4,
|
|
116
|
+
tier: "mark",
|
|
117
|
+
voice: "axis",
|
|
118
|
+
x: a + (o ? s + 2 : -s - 2),
|
|
119
|
+
y: r - 12,
|
|
120
|
+
children: e.format(t.before)
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
});
|
|
124
|
+
}, N = (e, t) => e.after <= e.before ? `${t(e.before - e.after)} less` : `${t(e.after - e.before)} more`, P = (t, n) => {
|
|
125
|
+
if (t.length === 0) return "No data.";
|
|
126
|
+
let r = t[C(t.map((e) => Math.abs(e.before - e.after)))];
|
|
127
|
+
return `${e(t.length, "row")}. Biggest change: ${r.label}, ${n(r.before)} to ${n(r.after)}. The data table lists every row.`;
|
|
128
|
+
}, F = (e) => {
|
|
129
|
+
let t = /* @__PURE__ */ new Map();
|
|
130
|
+
return e.map((e) => {
|
|
131
|
+
let r = n(e), i = t.get(r) ?? 0;
|
|
132
|
+
return t.set(r, i + 1), `${r}#${i}`;
|
|
133
|
+
});
|
|
134
|
+
}, I = (e) => {
|
|
135
|
+
let c = (e.data ?? []).filter((e) => Number.isFinite(e.before) && Number.isFinite(e.after)), l = e.height ?? 380, u = t(e.format), f = o(e.unit !== void 0 && e.unit > 0 ? e.unit : 1, Math.max(0, ...c.map((e) => Math.abs(e.before - e.after)))), p = e.alert ?? "rise", m = e.ends ?? ["0", "Units"], g = F(c), y = e.emphasis === void 0 ? C(c.map((e) => Math.abs(e.before - e.after))) : c.findIndex((t) => n(t) === e.emphasis), S = r(), w = e.title ?? (c.length === 0 ? "No data" : c.map((e) => `${e.label}: ${u(e.before)} to ${u(e.after)}`).join(", "));
|
|
136
|
+
return /* @__PURE__ */ T(i, {
|
|
137
|
+
...v(e),
|
|
138
|
+
initialWidth: e.initialWidth,
|
|
139
|
+
table: _(e, e.title ?? "Before and after", [
|
|
140
|
+
"Label",
|
|
141
|
+
"Before",
|
|
142
|
+
"After"
|
|
143
|
+
], c.map((e) => [
|
|
144
|
+
e.label,
|
|
145
|
+
u(e.before),
|
|
146
|
+
u(e.after)
|
|
147
|
+
])),
|
|
148
|
+
width: e.width,
|
|
149
|
+
overlay: S.at === null ? null : /* @__PURE__ */ T(a, {
|
|
150
|
+
x: S.at.x,
|
|
151
|
+
y: S.at.y,
|
|
152
|
+
children: /* @__PURE__ */ T(d, {
|
|
153
|
+
facts: [`${u(c[S.at.key].before)} → ${u(c[S.at.key].after)}`, N(c[S.at.key], u)],
|
|
154
|
+
lead: c[S.at.key].label
|
|
155
|
+
})
|
|
156
|
+
}),
|
|
157
|
+
children: (t) => {
|
|
158
|
+
let n = k(t, l, c, s(e) !== void 0, u, e.metrics), r = l - (s(e) === void 0 ? 10 : 40);
|
|
159
|
+
return /* @__PURE__ */ E(b, {
|
|
160
|
+
desc: P(c, u),
|
|
161
|
+
height: l,
|
|
162
|
+
label: w,
|
|
163
|
+
leave: S.clear,
|
|
164
|
+
width: t,
|
|
165
|
+
children: [
|
|
166
|
+
c.map((e, r) => /* @__PURE__ */ T(M, {
|
|
167
|
+
alert: p,
|
|
168
|
+
datum: e,
|
|
169
|
+
dim: S.dim(r),
|
|
170
|
+
format: u,
|
|
171
|
+
hero: y === r,
|
|
172
|
+
index: r,
|
|
173
|
+
layout: n,
|
|
174
|
+
onHover: S.showAt(r),
|
|
175
|
+
unit: f,
|
|
176
|
+
width: t
|
|
177
|
+
}, g[r])),
|
|
178
|
+
/* @__PURE__ */ T(x, {
|
|
179
|
+
voice: "axis",
|
|
180
|
+
x: n.x.range()[0],
|
|
181
|
+
y: r,
|
|
182
|
+
children: m[0]
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ T(x, {
|
|
185
|
+
anchor: "end",
|
|
186
|
+
voice: "axis",
|
|
187
|
+
x: n.x.range()[1],
|
|
188
|
+
y: r,
|
|
189
|
+
children: m[1]
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ T(h, {
|
|
192
|
+
height: l,
|
|
193
|
+
metrics: e.metrics,
|
|
194
|
+
text: s(e),
|
|
195
|
+
width: t
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}, L = (e) => y(e.idPrefix, /* @__PURE__ */ T(I, { ...e }));
|
|
202
|
+
//#endregion
|
|
203
|
+
export { L as DumbbellQueue };
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { axisFormat as e, fmtInt as t, monthTickLabels as n, plural as r } from "../../lib/format.js";
|
|
3
|
+
import { resolveDateFormat as i, resolveFormat as a } from "../../schema/format.js";
|
|
4
|
+
import { useHover as o } from "../hooks.js";
|
|
5
|
+
import { Plot as s, Tooltip as c } from "../core.js";
|
|
6
|
+
import { noteOf as l, sansWidth as u, stagger as d } from "../util.js";
|
|
7
|
+
import { TipText as f } from "../hover.js";
|
|
8
|
+
import "../marks.js";
|
|
9
|
+
import { Dot as p } from "../markers.js";
|
|
10
|
+
import { FootNote as m } from "../plot-note.js";
|
|
11
|
+
import { HRule as h } from "../rules.js";
|
|
12
|
+
import { chartTable as g, plotOptions as _, pointerX as v, scoped as y } from "../shared-options.js";
|
|
13
|
+
import { ChartSvg as ee } from "../svg.js";
|
|
14
|
+
import { Label as b } from "../text.js";
|
|
15
|
+
import { paint as te, useTextureIds as x } from "../texture-ids.js";
|
|
16
|
+
import { Stipple as ne } from "../texture.js";
|
|
17
|
+
import { ValueGrid as re } from "../value-grid.js";
|
|
18
|
+
import { DailyEmpty as S } from "./daily-empty.js";
|
|
19
|
+
import { heroOf as C, isLive as w, reactKeyOf as T, readingRows as E, readingsOf as D, seriesOf as O, valueAt as k } from "./daily-readings.js";
|
|
20
|
+
import { dailyFloor as A } from "./util-a.js";
|
|
21
|
+
import { scaleLinear as j } from "d3-scale";
|
|
22
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
23
|
+
import { area as F, line as I } from "d3-shape";
|
|
24
|
+
//#region src/charts/basics/hairline-area.tsx
|
|
25
|
+
var L = (e, t) => e ? "grow-y fill-hero" : t ? "grow-y fill-l2" : "grow-y fill-l4", R = 120, z = (e, t, n) => (n.monthly ? e.date.getUTCDate() === 1 : e.date.getUTCDay() === 1) || t === n.hero || t === n.hover, B = ({ frame: e, hero: t, hover: n, live: r, readings: i }) => /* @__PURE__ */ N("g", { children: r.map((r) => {
|
|
26
|
+
let a = i.length > R;
|
|
27
|
+
if (!z(i[r], r, {
|
|
28
|
+
hero: t,
|
|
29
|
+
hover: n,
|
|
30
|
+
monthly: a
|
|
31
|
+
})) return null;
|
|
32
|
+
let o = Math.round(e.y(k(i, r))), s = Math.round(e.floor);
|
|
33
|
+
return /* @__PURE__ */ N("rect", {
|
|
34
|
+
className: `transition-tone ${L(r === t, r === n)}`,
|
|
35
|
+
height: Math.max(0, s - o),
|
|
36
|
+
style: d(r, "fine"),
|
|
37
|
+
width: 2,
|
|
38
|
+
x: Math.round(e.x(r)) - 1,
|
|
39
|
+
y: o
|
|
40
|
+
}, T(i[r], r));
|
|
41
|
+
}) }), V = ({ frame: e, readings: t }) => {
|
|
42
|
+
let r = t.length > R ? 3 : 1, i = t.flatMap((e, t) => e.date.getUTCDate() === 1 && e.date.getUTCMonth() % r === 0 ? [t] : []), a = i.includes(0) ? i : [0, ...i], o = n(a.map((e) => t[e].date));
|
|
43
|
+
return /* @__PURE__ */ N("g", { children: a.map((n, r) => /* @__PURE__ */ N(b, {
|
|
44
|
+
anchor: r === 0 ? "start" : "middle",
|
|
45
|
+
dx: r === 0 ? -6 : 0,
|
|
46
|
+
voice: "axis",
|
|
47
|
+
x: e.x(n),
|
|
48
|
+
y: e.floor + 20,
|
|
49
|
+
children: o[r]
|
|
50
|
+
}, T(t[n], n))) });
|
|
51
|
+
}, H = (e, t, n) => {
|
|
52
|
+
let r = n?.at(-1);
|
|
53
|
+
if (r !== void 0 && r > 0) return j().domain([0, r]).range([t, 40]);
|
|
54
|
+
let i = Math.min(0, e.lo), a = Math.max(i + 1, e.hi);
|
|
55
|
+
return j().domain([i, a]).nice(4).range([t, 40]);
|
|
56
|
+
}, U = (e, t) => {
|
|
57
|
+
let [n] = e;
|
|
58
|
+
for (let r of e) Math.abs(r - t) < Math.abs(n - t) && (n = r);
|
|
59
|
+
return n;
|
|
60
|
+
}, W = ({ format: e, frame: t, value: n, x: r }) => /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(p, {
|
|
61
|
+
className: "pop fill-hero",
|
|
62
|
+
cx: r,
|
|
63
|
+
cy: t.y(n),
|
|
64
|
+
size: "md",
|
|
65
|
+
style: d(40, "fine")
|
|
66
|
+
}), /* @__PURE__ */ N(b, {
|
|
67
|
+
anchor: "middle",
|
|
68
|
+
order: 10,
|
|
69
|
+
voice: "value",
|
|
70
|
+
x: r,
|
|
71
|
+
y: t.y(n) - 13,
|
|
72
|
+
children: e(n)
|
|
73
|
+
})] }), G = (e, t) => ({
|
|
74
|
+
fill: F().defined(w).x((e, n) => t.x(n)).y0(Math.round(t.floor)).y1((e) => t.y(e.value ?? 0))(e) ?? "",
|
|
75
|
+
path: I().defined(w).x((e, n) => t.x(n)).y((e) => t.y(e.value ?? 0))(e) ?? ""
|
|
76
|
+
}), K = (e, t) => {
|
|
77
|
+
let n = Math.min(e - 16, t + 48), r = Math.round((e - n) / 2);
|
|
78
|
+
return [r, r + n];
|
|
79
|
+
}, q = (e, t, n) => {
|
|
80
|
+
let r = t < 0 ? 0 : Math.ceil(u(n(k(e, t)), 12) / 2) + 2;
|
|
81
|
+
return t === 0 ? Math.max(8, r) : 8;
|
|
82
|
+
}, J = ({ clear: t, stipple: n, emphasis: i, fmtDate: a, format: o, height: s, hover: c, maxWidth: l, metrics: u, note: f, readings: g, show: _, title: y, ticks: b, wholeNumbers: x, width: w }) => {
|
|
83
|
+
let T = O(g), { live: E } = T, D = A(s, f, w, u);
|
|
84
|
+
if (E.length === 0) return /* @__PURE__ */ N(S, {
|
|
85
|
+
floor: D,
|
|
86
|
+
height: s,
|
|
87
|
+
name: y,
|
|
88
|
+
width: w
|
|
89
|
+
});
|
|
90
|
+
let M = E.map((e) => k(g, e)), F = Math.max(...M), I = E[M.indexOf(F)], L = C(g, E, i, I), R = g.length - 1, [z, J] = K(w, l), Y = q(g, L, o), X = {
|
|
91
|
+
floor: D,
|
|
92
|
+
x: j().domain([0, Math.max(1, R)]).range([z + Y, J - 48]),
|
|
93
|
+
y: H({
|
|
94
|
+
hi: F,
|
|
95
|
+
lo: Math.min(...M)
|
|
96
|
+
}, D, b)
|
|
97
|
+
}, { fill: Z, path: ie } = G(g, X), Q = b ?? X.y.ticks(4), [ae] = E, $ = a(g[I].date), oe = `Daily values, ${a(g[ae].date)} to ${a(g[E.at(-1) ?? 0].date)}: peak ${o(F)} on ${$}`, se = `${r(E.length, "reading")}. Peak ${o(F)} on ${$}. The data table lists every reading.`;
|
|
98
|
+
return /* @__PURE__ */ P(ee, {
|
|
99
|
+
className: "touch-pan-y",
|
|
100
|
+
height: s,
|
|
101
|
+
desc: se,
|
|
102
|
+
label: y ?? oe,
|
|
103
|
+
leave: t,
|
|
104
|
+
onPointerMove: (e) => {
|
|
105
|
+
let t = v(e, w), n = X.x.invert(t), r = U(E, n), i = r === L ? 16 : 10;
|
|
106
|
+
_(r, X.x(r), X.y(k(g, r)) - i);
|
|
107
|
+
},
|
|
108
|
+
width: w,
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ N("defs", { children: /* @__PURE__ */ N(ne, {
|
|
111
|
+
id: n,
|
|
112
|
+
tone: "fill-l3"
|
|
113
|
+
}) }),
|
|
114
|
+
/* @__PURE__ */ N(re, {
|
|
115
|
+
labelFloor: !0,
|
|
116
|
+
side: "right",
|
|
117
|
+
floor: D,
|
|
118
|
+
format: e(o, x, Q),
|
|
119
|
+
ticks: Q,
|
|
120
|
+
x0: z,
|
|
121
|
+
x1: J,
|
|
122
|
+
y: X.y
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ N("path", {
|
|
125
|
+
className: "fade",
|
|
126
|
+
d: Z,
|
|
127
|
+
fill: te(n),
|
|
128
|
+
style: d(2, "series")
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ N(B, {
|
|
131
|
+
frame: X,
|
|
132
|
+
hero: L,
|
|
133
|
+
hover: c,
|
|
134
|
+
...T
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ N(h, {
|
|
137
|
+
x0: z,
|
|
138
|
+
x1: J,
|
|
139
|
+
y: D
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ N("path", {
|
|
142
|
+
className: "draw stroke-l3 stroke-medium cap-round fill-none",
|
|
143
|
+
d: ie,
|
|
144
|
+
pathLength: 1,
|
|
145
|
+
style: d(4, "series")
|
|
146
|
+
}),
|
|
147
|
+
c === null || c === L ? null : /* @__PURE__ */ N(p, {
|
|
148
|
+
className: "fill-l2",
|
|
149
|
+
cx: X.x(c),
|
|
150
|
+
cy: X.y(k(g, c)),
|
|
151
|
+
size: "sm"
|
|
152
|
+
}),
|
|
153
|
+
L < 0 ? null : /* @__PURE__ */ N(W, {
|
|
154
|
+
format: o,
|
|
155
|
+
frame: X,
|
|
156
|
+
value: k(g, L),
|
|
157
|
+
x: X.x(L)
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ N(V, {
|
|
160
|
+
frame: X,
|
|
161
|
+
readings: g
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ N(m, {
|
|
164
|
+
gutter: 12,
|
|
165
|
+
height: s,
|
|
166
|
+
metrics: u,
|
|
167
|
+
text: f,
|
|
168
|
+
width: w
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
});
|
|
172
|
+
}, Y = (e) => {
|
|
173
|
+
let n = D(e.data ?? []), r = e.format === void 0 ? t : a(e.format), u = i(e.dateFormat), { at: d, clear: p, key: m, show: h } = o(), v = x("daily")("stipple"), y = d === null ? void 0 : n[d.key];
|
|
174
|
+
return /* @__PURE__ */ N(s, {
|
|
175
|
+
initialWidth: e.initialWidth,
|
|
176
|
+
width: e.width,
|
|
177
|
+
..._(e),
|
|
178
|
+
table: g(e, e.title ?? "Daily values", ["Date", "Value"], E(n, u, r)),
|
|
179
|
+
overlay: d === null || y === void 0 ? null : /* @__PURE__ */ N(c, {
|
|
180
|
+
x: d.x,
|
|
181
|
+
y: d.y,
|
|
182
|
+
children: /* @__PURE__ */ N(f, {
|
|
183
|
+
facts: [r(y.value ?? 0)],
|
|
184
|
+
lead: u(y.date)
|
|
185
|
+
})
|
|
186
|
+
}),
|
|
187
|
+
children: (t) => /* @__PURE__ */ N(J, {
|
|
188
|
+
clear: p,
|
|
189
|
+
emphasis: e.emphasis,
|
|
190
|
+
stipple: v,
|
|
191
|
+
fmtDate: u,
|
|
192
|
+
format: r,
|
|
193
|
+
height: e.height ?? 440,
|
|
194
|
+
hover: m,
|
|
195
|
+
maxWidth: e.maxWidth ?? 640,
|
|
196
|
+
metrics: e.metrics,
|
|
197
|
+
note: l(e),
|
|
198
|
+
readings: n,
|
|
199
|
+
show: h,
|
|
200
|
+
title: e.title,
|
|
201
|
+
ticks: e.ticks,
|
|
202
|
+
wholeNumbers: e.format === void 0,
|
|
203
|
+
width: t
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
}, X = (e) => y(e.idPrefix, /* @__PURE__ */ N(Y, { ...e }));
|
|
207
|
+
//#endregion
|
|
208
|
+
export { X as HairlineArea };
|