Skip to content

feat(s2): refine Gauge chart mark#774

Open
alangwilson wants to merge 2 commits into
adobe:mainfrom
alangwilson:claude/gracious-faraday-17ec95
Open

feat(s2): refine Gauge chart mark#774
alangwilson wants to merge 2 commits into
adobe:mainfrom
alangwilson:claude/gracious-faraday-17ec95

Conversation

@alangwilson

@alangwilson alangwilson commented Apr 21, 2026

Copy link
Copy Markdown

Summary

  • Size system: Added S/M/L/XL size tiers with a GAUGE_SIZE_CONFIG lookup table controlling typography, needle dimensions, pivot diameter/stroke, and tick density
  • Needle scaling: Pivot diameter (7–21px), tip gap (4–12px), and base/tip half-widths all scale per size tier
  • Tick marks: New ticks prop (minimal | normal | dense) renders decorative rule marks inside the inner radius using a nice-interval algorithm; tick length and count scale per size
  • Aggregation: method prop now supports avg and sum in addition to last, using Vega aggregate transforms
  • holeRatio clamping: Value is now clamped to 0.65–0.9 at spec build time
  • Label improvements: Range labels updated to Adobe Clean Regular 18px gray-700; value/metric label Y positions converted to radius fractions so they scale with container size

Test plan

  • Run yarn test — all 229 suites pass
  • Run yarn lint — no errors
  • Open Storybook S2 (yarn storybook:s2) and verify:
    • Gauge / WithSizeS, WithSizeM, WithSizeL, WithSizeXL — needle, text, and ticks scale correctly
    • Gauge / WithTicksMinimal, WithTicksNormal, WithTicksDense — tick densities render as expected
    • Gauge / WithAggregation — value shows average (60) of [40, 60, 80]
    • Gauge / Default and threshold/needle stories — no regressions

🤖 Generated with Claude Code

Alan Wilson and others added 2 commits April 21, 2026 14:56
Implements the full Gauge chart component for the react-spectrum-charts-s2 package, including needle mode, fill mode, threshold zones, target tick marker, range labels, and value/metric labels.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add S/M/L/XL size system with per-size typography and needle dimensions
- Scale needle pivot, tip gap, base/tip half-width across sizes
- Add tick marks (minimal/normal/dense) rendered inside inner radius
- Scale tick length and density per size via GAUGE_SIZE_CONFIG lookup
- Add avg/sum aggregation methods alongside existing last
- Clamp holeRatio to 0.65–0.9
- Convert label Y positions to radius fractions for size-independence
- Update range label styling to Adobe Clean Regular 18px gray-700
- Add Storybook stories for aggregation, ticks, and all four sizes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant