@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,210 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useHover as e } from "../hooks.js";
|
|
3
|
+
import { Plot as t, Tooltip as n } from "../core.js";
|
|
4
|
+
import { noteLines as r, noteOf as i, ranks as a, sansWidth as o, stagger as s, wrapWords as c } from "../util.js";
|
|
5
|
+
import { DimGroup as l, HitPath as u, TipText as d } from "../hover.js";
|
|
6
|
+
import { RING_STEP as f } from "../marks.js";
|
|
7
|
+
import { FootNote as p } from "../plot-note.js";
|
|
8
|
+
import { ChartSvg as m } from "../svg.js";
|
|
9
|
+
import { Label as h } from "../text.js";
|
|
10
|
+
import { inkWidth as g } from "./util-b.js";
|
|
11
|
+
import { DotRing as _ } from "../texture.js";
|
|
12
|
+
import { tickDonutDemo as v } from "./tick-donut.data.js";
|
|
13
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
14
|
+
import { arc as x } from "d3-shape";
|
|
15
|
+
//#region src/charts/basics/tick-donut.tsx
|
|
16
|
+
var S = 100, C = 6, w = [
|
|
17
|
+
"stroke-l3",
|
|
18
|
+
"stroke-l4",
|
|
19
|
+
"stroke-l5",
|
|
20
|
+
"stroke-l6"
|
|
21
|
+
], T = (e) => o(e, 12), E = (e) => {
|
|
22
|
+
let t = e.reduce((e, t) => e + t, 0), n = e.map((e) => t > 0 ? e / t * S : 0), r = n.map((e) => Math.floor(e)), i = S - r.reduce((e, t) => e + t, 0), a = n.map((e, t) => ({
|
|
23
|
+
i: t,
|
|
24
|
+
rem: e - Math.floor(e)
|
|
25
|
+
})).toSorted((e, t) => t.rem - e.rem);
|
|
26
|
+
for (let { i: e } of a) {
|
|
27
|
+
if (i <= 0) break;
|
|
28
|
+
r[e] += 1, --i;
|
|
29
|
+
}
|
|
30
|
+
return r;
|
|
31
|
+
}, D = (e, t, n) => {
|
|
32
|
+
let r = (t - 90) * Math.PI / 180;
|
|
33
|
+
return {
|
|
34
|
+
x: e.cx + n * Math.cos(r),
|
|
35
|
+
y: e.cy + n * Math.sin(r)
|
|
36
|
+
};
|
|
37
|
+
}, O = (e) => e / S * 360, k = 14, A = 14, j = 4, M = (e, t) => {
|
|
38
|
+
let n = Math.sin(e * Math.PI / 180), r = Math.cos(e * Math.PI / 180), i = (t - 1) * A;
|
|
39
|
+
return n > .25 ? {
|
|
40
|
+
anchor: "start",
|
|
41
|
+
dy: 3.5 - i / 2
|
|
42
|
+
} : n < -.25 ? {
|
|
43
|
+
anchor: "end",
|
|
44
|
+
dy: 3.5 - i / 2
|
|
45
|
+
} : {
|
|
46
|
+
anchor: "middle",
|
|
47
|
+
dy: r > 0 ? -4 - i : 10
|
|
48
|
+
};
|
|
49
|
+
}, N = (e, t, n, r) => {
|
|
50
|
+
let i = Math.sin(n * Math.PI / 180), a = t + (r + k) * i;
|
|
51
|
+
return i > .25 ? e - j - a : i < -.25 ? a - j : 2 * Math.min(a, e - a) - 8;
|
|
52
|
+
}, P = (e, t, n) => {
|
|
53
|
+
let r = e * Math.PI / 180, i = (t - 1) * A;
|
|
54
|
+
return Math.abs(Math.sin(r)) > .25 ? Math.abs(Math.cos(r)) * (n + k) + i / 2 + 12 : n + k + 14 + i;
|
|
55
|
+
}, F = (e, t, n) => {
|
|
56
|
+
let r = Math.abs(Math.sin(t * Math.PI / 180));
|
|
57
|
+
return r > .25 ? (e / 2 - j - n) / r - k : Infinity;
|
|
58
|
+
}, I = (e, t) => {
|
|
59
|
+
let n = `${e.name} · ${e.value}`;
|
|
60
|
+
return T(n) <= t ? [n] : [...c(e.name, t, T), e.value];
|
|
61
|
+
}, L = (e, t, n) => {
|
|
62
|
+
let r = Math.min(...n.map((t) => F(e, t.mid, T(`${t.name} · ${t.value}`)))), i = Math.min(t, Math.max(Math.max(56, t * .85), r)), a = Math.min(...n.map((t) => I(t, N(e, e / 2, t.mid, i)).length === 1 ? Infinity : F(e, t.mid, Math.max(T(t.name), T(t.value)))));
|
|
63
|
+
return Math.max(56, Math.min(i, a));
|
|
64
|
+
}, R = (e, t, n, r) => {
|
|
65
|
+
let i = e - t - 4, a = e + t + 4;
|
|
66
|
+
for (let [o, s] of n.entries()) {
|
|
67
|
+
let n = e + (t + k) * Math.sin(s.mid * Math.PI / 180), c = Math.max(...(r[o] ?? []).map((e) => g(e))), { anchor: l } = M(s.mid, r[o]?.length ?? 1);
|
|
68
|
+
i = Math.min(i, l === "start" ? n : n - (l === "end" ? c : c / 2)), a = Math.max(a, l === "end" ? n : n + (l === "start" ? c : c / 2));
|
|
69
|
+
}
|
|
70
|
+
return [i, a];
|
|
71
|
+
}, z = ({ count: e, datum: t, dial: n, dim: r, hero: i, lines: a, onEnter: o, rank: c, start: d }) => {
|
|
72
|
+
let f = i ? "stroke-hero" : w[Math.max(0, Math.min(c, w.length) - 1)], p = O(d), m = O(d + e), g = (p + m) / 2, _ = D(n, g, n.rOut + k), v = M(g, a.length), S = Math.max(_.y, 11 - v.dy), C = x().innerRadius(n.rIn - 14).outerRadius(n.rOut + 10)({
|
|
73
|
+
endAngle: m * Math.PI / 180,
|
|
74
|
+
startAngle: p * Math.PI / 180
|
|
75
|
+
}) ?? "", T = Array.from({ length: e }, (e, t) => ({
|
|
76
|
+
id: `tick-${d + t}`,
|
|
77
|
+
t: d + t
|
|
78
|
+
})), E = D(n, g, n.rOut);
|
|
79
|
+
return /* @__PURE__ */ b(l, {
|
|
80
|
+
dim: r,
|
|
81
|
+
onPointerEnter: () => {
|
|
82
|
+
o(E.x, E.y - 8);
|
|
83
|
+
},
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ y(u, {
|
|
86
|
+
d: C,
|
|
87
|
+
transform: `translate(${n.cx},${n.cy})`
|
|
88
|
+
}),
|
|
89
|
+
T.map((e) => /* @__PURE__ */ y("g", {
|
|
90
|
+
transform: `rotate(${O(e.t)} ${n.cx} ${n.cy})`,
|
|
91
|
+
children: /* @__PURE__ */ y("line", {
|
|
92
|
+
className: `grow-y ${f}`,
|
|
93
|
+
strokeWidth: 2,
|
|
94
|
+
style: s(e.t, "dense"),
|
|
95
|
+
x1: n.cx,
|
|
96
|
+
x2: n.cx,
|
|
97
|
+
y1: n.cy - n.rIn,
|
|
98
|
+
y2: n.cy - n.rOut - (e.t % 10 == 0 ? 4 : 0)
|
|
99
|
+
})
|
|
100
|
+
}, e.id)),
|
|
101
|
+
/* @__PURE__ */ y(h, {
|
|
102
|
+
anchor: v.anchor,
|
|
103
|
+
muted: !i,
|
|
104
|
+
order: 4 + c,
|
|
105
|
+
voice: "label",
|
|
106
|
+
children: a.map((e, n) => /* @__PURE__ */ y("tspan", {
|
|
107
|
+
dy: n === 0 ? v.dy : A,
|
|
108
|
+
x: _.x,
|
|
109
|
+
y: n === 0 ? S : void 0,
|
|
110
|
+
children: e
|
|
111
|
+
}, `${t.label}-${e}`))
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
});
|
|
115
|
+
}, B = ({ center: e, clear: t, data: n, dim: i, format: o, height: s, highlight: c, note: l, show: u, width: d }) => {
|
|
116
|
+
let g = n.map((e) => e.value), v = E(g), x = a(g), S = r(l, d - 24), w = S.length > 0 ? 18 + S.length * 12 : 0, T = d < 440 ? 72 : 128, D = v.map((e, t) => v.slice(0, t).reduce((e, t) => e + t, 0)), k = n.map((e, t) => ({
|
|
117
|
+
mid: O(D[t] + v[t] / 2),
|
|
118
|
+
name: e.label,
|
|
119
|
+
value: `${v[t]}%`
|
|
120
|
+
})), A = L(d, Math.max(56, Math.min(148, (s - w) / 2 - 40, (d - T * 2) / 2)), k), j = Math.max(12, A * .17), M = (e) => k.map((t) => I(t, N(d, e, t.mid, A))), F = (e, t) => {
|
|
121
|
+
let [n, r] = R(e, A, k, t);
|
|
122
|
+
return e + (d - n - r) / 2;
|
|
123
|
+
}, B = d / 2, V = F(B, M(B)), H = M(V), U = F(V, H), W = Math.max(A + 8, ...k.map((e, t) => P(e.mid, H[t].length, A))), G = Math.min(s - w, Math.ceil(2 * W + 24)), K = {
|
|
124
|
+
cx: U,
|
|
125
|
+
cy: G / 2 + 4,
|
|
126
|
+
rIn: A - j,
|
|
127
|
+
rOut: A,
|
|
128
|
+
tickLen: j
|
|
129
|
+
}, q = `Shares of the whole: ${n.map((e) => `${e.label} ${o(e.value)}`).join(", ")}`;
|
|
130
|
+
return /* @__PURE__ */ b(m, {
|
|
131
|
+
height: G + w,
|
|
132
|
+
label: q,
|
|
133
|
+
leave: t,
|
|
134
|
+
width: d,
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ y(_, {
|
|
137
|
+
className: "fade",
|
|
138
|
+
tone: "fill-l4",
|
|
139
|
+
cx: K.cx,
|
|
140
|
+
cy: K.cy,
|
|
141
|
+
r: K.rIn - C,
|
|
142
|
+
step: f.guide
|
|
143
|
+
}),
|
|
144
|
+
n.map((e, t) => /* @__PURE__ */ y(z, {
|
|
145
|
+
count: v[t],
|
|
146
|
+
datum: e,
|
|
147
|
+
dial: K,
|
|
148
|
+
dim: i(t),
|
|
149
|
+
hero: (c ?? x.indexOf(0)) === t,
|
|
150
|
+
lines: H[t],
|
|
151
|
+
onEnter: (e, n) => {
|
|
152
|
+
u(t, e, n);
|
|
153
|
+
},
|
|
154
|
+
rank: x[t],
|
|
155
|
+
start: D[t]
|
|
156
|
+
}, e.label)),
|
|
157
|
+
/* @__PURE__ */ y(h, {
|
|
158
|
+
anchor: "middle",
|
|
159
|
+
className: "fade",
|
|
160
|
+
voice: "figure",
|
|
161
|
+
x: K.cx,
|
|
162
|
+
y: K.cy + 6,
|
|
163
|
+
children: e.value
|
|
164
|
+
}),
|
|
165
|
+
r(K.rIn < 56 ? "" : e.caption, K.rIn * 1.7).map((e, t) => /* @__PURE__ */ y(h, {
|
|
166
|
+
anchor: "middle",
|
|
167
|
+
className: "fade",
|
|
168
|
+
voice: "axis",
|
|
169
|
+
x: K.cx,
|
|
170
|
+
y: K.cy + 24 + t * 12,
|
|
171
|
+
children: e
|
|
172
|
+
}, e)),
|
|
173
|
+
/* @__PURE__ */ y(p, {
|
|
174
|
+
gutter: 12,
|
|
175
|
+
height: G + w,
|
|
176
|
+
text: l,
|
|
177
|
+
width: d
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
});
|
|
181
|
+
}, V = (r) => {
|
|
182
|
+
let a = r.data ?? v, o = r.format ?? String, s = e(), c = a.reduce((e, t) => e + t.value, 0);
|
|
183
|
+
return /* @__PURE__ */ y(t, {
|
|
184
|
+
overlay: s.at === null ? null : /* @__PURE__ */ y(n, {
|
|
185
|
+
x: s.at.x,
|
|
186
|
+
y: s.at.y,
|
|
187
|
+
children: /* @__PURE__ */ y(d, {
|
|
188
|
+
facts: [o(a[s.at.key].value), ((e) => `${c > 0 ? Math.round(e / c * 100) : 0}%`)(a[s.at.key].value)],
|
|
189
|
+
lead: a[s.at.key].label
|
|
190
|
+
})
|
|
191
|
+
}),
|
|
192
|
+
children: (e) => /* @__PURE__ */ y(B, {
|
|
193
|
+
center: r.center ?? {
|
|
194
|
+
caption: r.unit ?? "total",
|
|
195
|
+
value: o(c)
|
|
196
|
+
},
|
|
197
|
+
clear: s.clear,
|
|
198
|
+
data: a,
|
|
199
|
+
dim: s.dim,
|
|
200
|
+
format: o,
|
|
201
|
+
height: r.height ?? 420,
|
|
202
|
+
highlight: r.highlight,
|
|
203
|
+
note: i(r),
|
|
204
|
+
show: s.show,
|
|
205
|
+
width: e
|
|
206
|
+
})
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
//#endregion
|
|
210
|
+
export { V as TickDonut };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useHover as e } from "../hooks.js";
|
|
3
|
+
import { Plot as t, Tooltip as n } from "../core.js";
|
|
4
|
+
import { clamp as r, noteOf as i, stagger as a } from "../util.js";
|
|
5
|
+
import { TipText 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 { polar as d } from "./util-b.js";
|
|
11
|
+
import { DotRing as f } from "../texture.js";
|
|
12
|
+
import { tickGaugeDemo as p } from "./tick-gauge.data.js";
|
|
13
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
14
|
+
//#region src/charts/basics/tick-gauge.tsx
|
|
15
|
+
var g = Math.PI / 180, _ = [
|
|
16
|
+
.25,
|
|
17
|
+
.5,
|
|
18
|
+
.75,
|
|
19
|
+
1
|
|
20
|
+
], v = (e, t, n, r) => {
|
|
21
|
+
let i = d(e.cx, e.cy, t, n), a = d(e.cx, e.cy, t, r);
|
|
22
|
+
return `M${i.x},${i.y}A${t},${t} 0 ${+(r - n > Math.PI)} 1 ${a.x},${a.y}`;
|
|
23
|
+
}, y = (e, t, n, i, a, o) => {
|
|
24
|
+
let s = o ? 56 : 10, c = Math.max(-Math.cos(n / 2), .2), l = Math.min(e / 2 - 28, Math.max(150, e * .27), (t - 16 - s - 8) / (1 + c)), u = -n / 2, d = n / (i - 1), f = Math.min(t, Math.ceil(16 + s + 8 + l * (1 + c)));
|
|
25
|
+
return {
|
|
26
|
+
a0: u,
|
|
27
|
+
cx: e / 2,
|
|
28
|
+
cy: 16 + (f - 16 - s - l * (1 + c)) / 2 + l,
|
|
29
|
+
earned: a,
|
|
30
|
+
endA: u + Math.max(0, a - 1) * d + d * .9,
|
|
31
|
+
height: f,
|
|
32
|
+
len: r(l * .19, 14, 34),
|
|
33
|
+
n: i,
|
|
34
|
+
radius: l,
|
|
35
|
+
step: d,
|
|
36
|
+
sweep: n
|
|
37
|
+
};
|
|
38
|
+
}, b = (e, t) => e === t.earned - 1 ? "stroke-hero" : e < t.earned ? "stroke-l3" : "stroke-l6", x = 6, S = (e) => {
|
|
39
|
+
let { dial: t } = e, n = t.radius, r = Array.from({ length: t.n }, (e, r) => {
|
|
40
|
+
let i = t.a0 + r * t.step;
|
|
41
|
+
return {
|
|
42
|
+
i: r,
|
|
43
|
+
id: `tick-${r}`,
|
|
44
|
+
inner: d(t.cx, t.cy, n - t.len, i),
|
|
45
|
+
on: r < t.earned,
|
|
46
|
+
outer: d(t.cx, t.cy, n, i)
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
return /* @__PURE__ */ m("g", { children: r.map((e) => /* @__PURE__ */ m("line", {
|
|
50
|
+
className: `fade ${b(e.i, t)}`,
|
|
51
|
+
strokeWidth: 2,
|
|
52
|
+
style: a(e.i, "dense"),
|
|
53
|
+
x1: e.inner.x,
|
|
54
|
+
x2: e.outer.x,
|
|
55
|
+
y1: e.inner.y,
|
|
56
|
+
y2: e.outer.y
|
|
57
|
+
}, e.id)) });
|
|
58
|
+
}, C = (e) => {
|
|
59
|
+
let { dial: t } = e;
|
|
60
|
+
return /* @__PURE__ */ m("g", {
|
|
61
|
+
className: "fade",
|
|
62
|
+
style: a(12),
|
|
63
|
+
children: _.map((e) => {
|
|
64
|
+
let n = t.a0 + e * t.sweep, r = d(t.cx, t.cy, t.radius - t.len - 20, n), i = d(t.cx, t.cy, t.radius - t.len - 14, n), a = e === 1;
|
|
65
|
+
return /* @__PURE__ */ m(u, {
|
|
66
|
+
anchor: a ? "end" : "middle",
|
|
67
|
+
middle: !0,
|
|
68
|
+
voice: "axis",
|
|
69
|
+
x: a ? i.x - 4 : r.x,
|
|
70
|
+
y: a ? i.y : r.y,
|
|
71
|
+
children: Math.round(e * t.n)
|
|
72
|
+
}, e);
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
}, w = (e) => {
|
|
76
|
+
let { dial: t } = e, n = t.cy + 6;
|
|
77
|
+
return /* @__PURE__ */ h("g", { children: [/* @__PURE__ */ h(u, {
|
|
78
|
+
anchor: "middle",
|
|
79
|
+
className: "fade",
|
|
80
|
+
voice: "figure",
|
|
81
|
+
x: t.cx,
|
|
82
|
+
y: n,
|
|
83
|
+
children: [e.pct, "%"]
|
|
84
|
+
}), /* @__PURE__ */ m(u, {
|
|
85
|
+
anchor: "middle",
|
|
86
|
+
className: "fade",
|
|
87
|
+
voice: "axis",
|
|
88
|
+
x: t.cx,
|
|
89
|
+
y: n + 20,
|
|
90
|
+
children: e.caption
|
|
91
|
+
})] });
|
|
92
|
+
}, T = (e) => {
|
|
93
|
+
let { dial: t } = e, n = t.radius - t.len / 2, r = t.a0 + t.sweep + t.step / 2, i = [{
|
|
94
|
+
a0: t.a0 - t.step / 2,
|
|
95
|
+
a1: t.endA,
|
|
96
|
+
part: "earned",
|
|
97
|
+
show: t.earned > 0
|
|
98
|
+
}, {
|
|
99
|
+
a0: t.endA,
|
|
100
|
+
a1: r,
|
|
101
|
+
part: "left",
|
|
102
|
+
show: t.earned < t.n
|
|
103
|
+
}];
|
|
104
|
+
return /* @__PURE__ */ m("g", { children: i.filter((e) => e.show).map((r) => /* @__PURE__ */ m("path", {
|
|
105
|
+
className: "fill-none stroke-transparent",
|
|
106
|
+
d: v(t, n, r.a0, r.a1),
|
|
107
|
+
onPointerEnter: () => {
|
|
108
|
+
let n = d(t.cx, t.cy, t.radius + 6, (r.a0 + r.a1) / 2);
|
|
109
|
+
e.onHover(r.part, n.x, n.y);
|
|
110
|
+
},
|
|
111
|
+
strokeWidth: t.len + 12
|
|
112
|
+
}, r.part)) });
|
|
113
|
+
}, E = (a) => {
|
|
114
|
+
let u = a.data ?? p, d = a.height ?? 350, _ = a.format ?? String, v = a.ticks ?? 100, b = (a.sweep ?? 240) * g, E = r(u.value / u.target, 0, 1), D = Math.round(E * v), O = a.caption?.(v - D) ?? `${_(Math.max(0, u.target - u.value))} to come`, k = Math.round(E * 100), A = `${k}% of target: ${_(u.value)} of ${_(u.target)}`, j = e(), M = j.key === "earned" ? /* @__PURE__ */ m(o, {
|
|
115
|
+
facts: [`${_(u.value)} of ${_(u.target)}`],
|
|
116
|
+
lead: "Fallen"
|
|
117
|
+
}) : /* @__PURE__ */ m(o, {
|
|
118
|
+
facts: [_(Math.max(0, u.target - u.value))],
|
|
119
|
+
lead: "To come"
|
|
120
|
+
});
|
|
121
|
+
return /* @__PURE__ */ m(t, {
|
|
122
|
+
overlay: j.at === null ? null : /* @__PURE__ */ m(n, {
|
|
123
|
+
x: j.at.x,
|
|
124
|
+
y: j.at.y,
|
|
125
|
+
children: M
|
|
126
|
+
}),
|
|
127
|
+
children: (e) => {
|
|
128
|
+
let t = y(e, d, b, v, D, i(a) !== void 0);
|
|
129
|
+
return /* @__PURE__ */ h(l, {
|
|
130
|
+
height: t.height,
|
|
131
|
+
label: A,
|
|
132
|
+
leave: j.clear,
|
|
133
|
+
width: e,
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ m(S, { dial: t }),
|
|
136
|
+
/* @__PURE__ */ m(f, {
|
|
137
|
+
className: "fade",
|
|
138
|
+
tone: "fill-l4",
|
|
139
|
+
cx: t.cx,
|
|
140
|
+
cy: t.cy,
|
|
141
|
+
from: t.a0,
|
|
142
|
+
r: t.radius - t.len - x,
|
|
143
|
+
step: s.guide,
|
|
144
|
+
to: t.a0 + t.sweep
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ m(C, { dial: t }),
|
|
147
|
+
/* @__PURE__ */ m(w, {
|
|
148
|
+
caption: O,
|
|
149
|
+
dial: t,
|
|
150
|
+
pct: k
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ m(T, {
|
|
153
|
+
dial: t,
|
|
154
|
+
onHover: (e, t, n) => {
|
|
155
|
+
j.show(e, t, n);
|
|
156
|
+
}
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ m(c, {
|
|
159
|
+
height: t.height,
|
|
160
|
+
text: i(a),
|
|
161
|
+
width: e
|
|
162
|
+
})
|
|
163
|
+
]
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
//#endregion
|
|
169
|
+
export { E as TickGauge };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/charts/basics/tick-rows.data.ts
|
|
3
|
+
var e = [
|
|
4
|
+
{
|
|
5
|
+
label: "House sparrow",
|
|
6
|
+
value: 1275378
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
label: "Blue tit",
|
|
10
|
+
value: 1114620
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
label: "Starling",
|
|
14
|
+
value: 796002
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: "Woodpigeon",
|
|
18
|
+
value: 787190
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: "Blackbird",
|
|
22
|
+
value: 598783
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "Great tit",
|
|
26
|
+
value: 562690
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
//#endregion
|
|
30
|
+
export { e as tickRowsDemo };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useHover as e } from "../hooks.js";
|
|
3
|
+
import { Plot as t, Tooltip as n } from "../core.js";
|
|
4
|
+
import { hasText as r, noteLines as i, noteOf as a, stagger as o, wrapWords as s } from "../util.js";
|
|
5
|
+
import { DimGroup as c, HitRect as l, TipText as u } from "../hover.js";
|
|
6
|
+
import { FootNote as d } from "../plot-note.js";
|
|
7
|
+
import { HRule as f } from "../rules.js";
|
|
8
|
+
import { ChartSvg as p } from "../svg.js";
|
|
9
|
+
import { Label as m } from "../text.js";
|
|
10
|
+
import { inkWidth as h, maxIndex as g } from "./util-b.js";
|
|
11
|
+
import { RUNG as _ } from "./rung-geometry.js";
|
|
12
|
+
import { tickRowsDemo as v } from "./tick-rows.data.js";
|
|
13
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
14
|
+
//#region src/charts/basics/tick-rows.tsx
|
|
15
|
+
var x = 14, S = (e) => h(e), C = (e, t) => {
|
|
16
|
+
let n = t < 440 ? 70 : 96, r = Math.max(0, ...e.map((e) => S(e))), i = Math.min(Math.max(n, Math.ceil(r)), Math.max(n, Math.round(t * .34))), a = e.map((e) => S(e) <= i ? [e] : s(e, i, S));
|
|
17
|
+
return {
|
|
18
|
+
labelW: Math.max(...a.flat().map((e) => Math.ceil(S(e)))),
|
|
19
|
+
lines: a
|
|
20
|
+
};
|
|
21
|
+
}, w = 5, T = (e) => e + Math.floor(Math.max(0, e - 1) / w), E = (e, t) => e.x0 + (t + Math.floor(t / w)) * e.pitch, D = ({ datum: e, dim: t, format: n, frame: r, hero: i, index: a, lines: s, onEnter: u, unit: d }) => {
|
|
22
|
+
let p = Math.round(e.value / d), h = Math.round(12 + (a + .5) * r.pitchY + r.tickH / 2), g = h - r.tickH / 2, v = E(r, Math.max(0, p - 1)) + _, S = Array.from({ length: p }, (t, n) => ({
|
|
23
|
+
id: `${e.label}-tick-${n}`,
|
|
24
|
+
k: n
|
|
25
|
+
}));
|
|
26
|
+
return /* @__PURE__ */ b(c, {
|
|
27
|
+
dim: t,
|
|
28
|
+
onPointerEnter: () => {
|
|
29
|
+
u(v, h - r.tickH - 8);
|
|
30
|
+
},
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ y(l, {
|
|
33
|
+
height: r.pitchY,
|
|
34
|
+
width: r.labelW + r.gap + r.track + 40,
|
|
35
|
+
x: r.x0 - r.labelW - r.gap,
|
|
36
|
+
y: g - r.pitchY / 2
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ y(f, {
|
|
39
|
+
kind: "rule",
|
|
40
|
+
x0: r.x0 - 3,
|
|
41
|
+
x1: r.x0 + r.track,
|
|
42
|
+
y: h
|
|
43
|
+
}),
|
|
44
|
+
S.map((e) => /* @__PURE__ */ y("rect", {
|
|
45
|
+
className: `grow-y ${i ? "fill-hero" : "fill-l3"}`,
|
|
46
|
+
height: r.tickH,
|
|
47
|
+
style: o(a * 3 + e.k, "fine"),
|
|
48
|
+
width: _,
|
|
49
|
+
x: E(r, e.k),
|
|
50
|
+
y: h - r.tickH
|
|
51
|
+
}, e.id)),
|
|
52
|
+
/* @__PURE__ */ y(m, {
|
|
53
|
+
anchor: "end",
|
|
54
|
+
muted: !0,
|
|
55
|
+
voice: "label",
|
|
56
|
+
y: g - (s.length - 1) * x / 2,
|
|
57
|
+
children: s.map((t, n) => /* @__PURE__ */ y("tspan", {
|
|
58
|
+
dy: n === 0 ? "0.35em" : x,
|
|
59
|
+
x: r.x0 - r.gap,
|
|
60
|
+
children: t
|
|
61
|
+
}, `${e.label}-${t}`))
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ y(m, {
|
|
64
|
+
className: i ? "fill-hero" : "",
|
|
65
|
+
dy: "0.35em",
|
|
66
|
+
order: a + 2,
|
|
67
|
+
voice: "value",
|
|
68
|
+
x: v + 12,
|
|
69
|
+
y: g,
|
|
70
|
+
children: n(e.value)
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
}, O = (o) => {
|
|
75
|
+
let s = o.data ?? v, c = o.unit ?? 1, l = o.format ?? String, f = r(a(o)), m = o.height ?? s.length * 66 + (f ? 56 : 24), _ = e(), x = s.map((e) => `${e.label} ${l(e.value)}`).join(", ");
|
|
76
|
+
return /* @__PURE__ */ y(t, {
|
|
77
|
+
overlay: _.at === null ? null : /* @__PURE__ */ y(n, {
|
|
78
|
+
x: _.at.x,
|
|
79
|
+
y: _.at.y,
|
|
80
|
+
children: /* @__PURE__ */ y(u, {
|
|
81
|
+
facts: [l(s[_.at.key].value)],
|
|
82
|
+
lead: s[_.at.key].label
|
|
83
|
+
})
|
|
84
|
+
}),
|
|
85
|
+
children: (e) => {
|
|
86
|
+
let { labelW: t, lines: n } = C(s.map((e) => e.label), e), r = e < 440 ? 12 : 22, u = T(Math.max(...s.map((e) => Math.round(e.value / c)))), v = Math.max(...s.map((e) => Math.ceil(h(l(e.value))))), S = Math.max(4, Math.min(9, Math.floor((e - 4 - t - r - 12 - v - 2) / Math.max(1, u - 1)))), w = (u - 1) * S + 2, E = u * S, O = i(a(o), e - 24), k = m + Math.max(0, O.length - 1) * 12, A = (m - (f ? 56 : 24)) / s.length, j = {
|
|
87
|
+
gap: r,
|
|
88
|
+
labelW: t,
|
|
89
|
+
pitch: S,
|
|
90
|
+
pitchY: A,
|
|
91
|
+
tickH: Math.round(Math.min(20, A * .3)),
|
|
92
|
+
track: E,
|
|
93
|
+
x0: Math.round((e - (t + r + w + 12 + v)) / 2 + t + r)
|
|
94
|
+
}, M = o.highlight ?? g(s.map((e) => e.value));
|
|
95
|
+
return /* @__PURE__ */ b(p, {
|
|
96
|
+
height: k,
|
|
97
|
+
label: x,
|
|
98
|
+
leave: _.clear,
|
|
99
|
+
width: e,
|
|
100
|
+
children: [s.map((e, t) => /* @__PURE__ */ y(D, {
|
|
101
|
+
datum: e,
|
|
102
|
+
dim: _.dim(t),
|
|
103
|
+
format: l,
|
|
104
|
+
frame: j,
|
|
105
|
+
hero: M === t,
|
|
106
|
+
index: t,
|
|
107
|
+
lines: n[t],
|
|
108
|
+
onEnter: _.showAt(t),
|
|
109
|
+
unit: c
|
|
110
|
+
}, e.label)), /* @__PURE__ */ y(d, {
|
|
111
|
+
gutter: 12,
|
|
112
|
+
height: k,
|
|
113
|
+
text: a(o),
|
|
114
|
+
width: e
|
|
115
|
+
})]
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
export { O as TickRows };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { noteLines as e } from "../util.js";
|
|
3
|
+
import { utcFormat as t } from "d3-time-format";
|
|
4
|
+
//#region src/charts/basics/util-a.ts
|
|
5
|
+
var n = (e) => e.getUTCDay() === 0 || e.getUTCDay() === 6;
|
|
6
|
+
t("%-d %b");
|
|
7
|
+
var r = (e, t) => {
|
|
8
|
+
let n = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
|
|
9
|
+
return n.setUTCDate(n.getUTCDate() + t), n;
|
|
10
|
+
}, i = (t, n, r, i) => {
|
|
11
|
+
let a = e(n, r - 24, i);
|
|
12
|
+
return Math.round(t - (a.length > 0 ? 56 : 34) - Math.max(0, a.length - 1) * 12);
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { i as dailyFloor, r as dayAfter, n as isWeekend };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { sansWidth as e } from "../util.js";
|
|
3
|
+
//#region src/charts/basics/util-b.ts
|
|
4
|
+
var t = (e, t, n, r) => ({
|
|
5
|
+
x: e + n * Math.sin(r),
|
|
6
|
+
y: t - n * Math.cos(r)
|
|
7
|
+
}), n = (e) => {
|
|
8
|
+
let t = 0;
|
|
9
|
+
for (let [n, r] of e.entries()) r > (e[t] ?? -Infinity) && (t = n);
|
|
10
|
+
return t;
|
|
11
|
+
}, r = (t, n) => (t.match(/\d/gu) ?? []).length * .65 * 11 + e(t.replaceAll(/\d/gu, ""), 11, n) * .93;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as inkWidth, n as maxIndex, t as polar };
|