[#1051] Fix airdrop chart label overlap via banded Y-axis#1052
Merged
realproject7 merged 1 commit intomainfrom May 5, 2026
Merged
[#1051] Fix airdrop chart label overlap via banded Y-axis#1052realproject7 merged 1 commit intomainfrom
realproject7 merged 1 commit intomainfrom
Conversation
Replaces pure log Y-axis with piecewise-linear-banded Y where each of the 4 milestones (bronze/silver/gold/diamond) gets a fixed 25% band of chart height. Within a band, position is log-interpolated between that band's lower and upper milestone values. Removes the Y-axis tick label column (the right-edge milestone labels are already sufficient and stacking another column reintroduces overlap). Adds subtle alternating band stripes for visual zone separation. Wraps right-edge labels in a <g class="hidden sm:block"> to keep responsive-class behavior consistent on SVG children. Verified manually: at currentFdv=$31K with prod milestones ($1M/$10M/$50M/$100M) the heartbeat dot lands at Y≈94% (pre-bronze band, near chart bottom); at $1M/$10M/$50M/$100M exactly it lands at 75/50/25/0% (band boundaries). Fixes #1051 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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.
Fixes #1051
Summary
The /airdrop chart from #1049 has the right concept (time-series, X=time, Y=MCap) but the pure log Y-axis math jams adjacent milestones together whenever their ratio is small relative to the total log range. In production the live page shows
$50K — unlocks 100%overlapping$35K — unlocks 50%, and$10K — unlocks 30%overlapping$7K — unlocks 10%.Replaces the log function
mcapToY(mcap, yMin, yMax)with a piecewise-linear-banded Y-axis where each of the 4 milestones gets an equal 25% band of chart height. Within a band, position is log-interpolated between that band's lower and upper milestone values.Milestone labels are anchored to band boundaries, so they're always 25% of chart height apart and cannot collide regardless of MCap ratios. Same chart geometry works for test mode and prod mode — only the milestone numeric values change.
Math sanity check (prod milestones $1M/$10M/$50M/$100M)
Other changes
$50floor label was coming from).<g className="hidden sm:block">instead of putting Tailwind responsive classes directly on<text>elements (the latter is non-portable for SVG).Files
src/components/airdrop/CampaignHero.tsx— replacemcapToYwithmakeMcapToY, drop Y-tick rendering, add band stripes, fix label wrapper.package.json— version bump 1.6.1 → 1.6.2 (3rd digit, bug fix).Test plan
npm run typecheckpasses (verified)npm run lintpasses — no new errors/warnings onCampaignHero.tsx(verified)$50-style floor label artifact on the left edgepl_daily_prices: chart frame + projection line + milestone lines + current dot still renderReviewer note
Block this PR if it:
Math.log10-based Y mapping over the whole [floor, diamond] range