feat(s2): refine Gauge chart mark#774
Open
alangwilson wants to merge 2 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GAUGE_SIZE_CONFIGlookup table controlling typography, needle dimensions, pivot diameter/stroke, and tick densityticksprop (minimal|normal|dense) renders decorative rule marks inside the inner radius using a nice-interval algorithm; tick length and count scale per sizemethodprop now supportsavgandsumin addition tolast, using Vega aggregate transformsTest plan
yarn test— all 229 suites passyarn lint— no errorsyarn storybook:s2) and verify:Gauge / WithSizeS,WithSizeM,WithSizeL,WithSizeXL— needle, text, and ticks scale correctlyGauge / WithTicksMinimal,WithTicksNormal,WithTicksDense— tick densities render as expectedGauge / WithAggregation— value shows average (60) of [40, 60, 80]Gauge / Defaultand threshold/needle stories — no regressions🤖 Generated with Claude Code