Two visible bugs on the new chart from #1056
1. Diamond milestone label is clipped at the right edge
Visible on https://plotlink.xyz/airdrop right now: `unlocks 100%` shows as `unlocks 1` and the CMC rank `≈ #250` is also truncated.
Cause: SVG viewBox is 0 0 600 110 and pad.right = 16. Diamond's vertical line sits at x = 16 + 1.0 × (600 - 16 - 16) = 584. The labels use text-anchor="middle" centered at x=584, so half of unlocks 100% (≈35px wide on each side) extends past x=600 and gets clipped.
Fix: increase pad.right to ~50 so the diamond line moves leftward and labels fit. Also bump pad.left to ~24 so the $0 endpoint label has room.
2. Current MCap caption shows raw float
`Current: $33.523555869999996K`
Cause: formatMcap does n / 1_000 and template-literals the result without rounding.
Fix: round the K/M value to 2 decimals (when not integer):
function formatMcap(n: number): string {
if (n >= 1_000_000) {
const m = n / 1_000_000;
return Number.isInteger(m) ? `$${m}M` : `$${m.toFixed(2)}M`;
}
if (n >= 1_000) {
const k = n / 1_000;
return Number.isInteger(k) ? `$${k}K` : `$${k.toFixed(2)}K`;
}
return `$${n.toFixed(0)}`;
}
Test cases:
formatMcap(1_000_000) → $1M (integer kept clean)
formatMcap(33_523.555) → $33.52K
formatMcap(50) → $50
Files
src/components/airdrop/CampaignHero.tsx
Acceptance criteria
Two visible bugs on the new chart from #1056
1. Diamond milestone label is clipped at the right edge
Visible on https://plotlink.xyz/airdrop right now: `unlocks 100%` shows as `unlocks 1` and the CMC rank `≈ #250` is also truncated.
Cause: SVG
viewBoxis0 0 600 110andpad.right = 16. Diamond's vertical line sits at x = 16 + 1.0 × (600 - 16 - 16) = 584. The labels usetext-anchor="middle"centered at x=584, so half ofunlocks 100%(≈35px wide on each side) extends past x=600 and gets clipped.Fix: increase
pad.rightto ~50 so the diamond line moves leftward and labels fit. Also bumppad.leftto ~24 so the$0endpoint label has room.2. Current MCap caption shows raw float
`Current: $33.523555869999996K`
Cause:
formatMcapdoesn / 1_000and template-literals the result without rounding.Fix: round the K/M value to 2 decimals (when not integer):
Test cases:
formatMcap(1_000_000)→$1M(integer kept clean)formatMcap(33_523.555)→$33.52KformatMcap(50)→$50Files
src/components/airdrop/CampaignHero.tsxAcceptance criteria
$100M / unlocks 100% / (≈ #250)$33.52K(or whatever the live value rounds to), not a long float