feat(rendering): adjust text position in SVG for better visibility.

This commit is contained in:
shay
2026-04-20 14:19:18 -04:00
parent 13cc2b4eed
commit fdd6b61172
+1 -1
View File
@@ -121,7 +121,7 @@ function renderGrade(data: GradeData, t: Theme, s?: { max_tags?: number }): stri
.map(([k]) => breakdownLabels[k] ?? k.charAt(0).toUpperCase() + k.slice(1))
const strengthsLine = topStrengths.length ? `Strong in ${topStrengths.join(' · ')}` : ''
let inner = `<g transform="translate(52, 48)"><circle cx="0" cy="0" r="${radius}" fill="none" stroke="${t.grid}" stroke-width="5"/><circle cx="0" cy="0" r="${radius}" fill="none" stroke="${color}" stroke-width="5" stroke-dasharray="${circ.toFixed(1)}" stroke-dashoffset="${offset.toFixed(1)}" stroke-linecap="round" transform="rotate(-90)"/><text x="0" y="2" text-anchor="middle" dominant-baseline="middle" font-family="${font}" font-size="${gf}" font-weight="800" fill="${color}">${esc(data.grade)}</text></g>
let inner = `<g transform="translate(52, 48)"><circle cx="0" cy="0" r="${radius}" fill="none" stroke="${t.grid}" stroke-width="5"/><circle cx="0" cy="0" r="${radius}" fill="none" stroke="${color}" stroke-width="5" stroke-dasharray="${circ.toFixed(1)}" stroke-dashoffset="${offset.toFixed(1)}" stroke-linecap="round" transform="rotate(-90)"/><text x="0" y="${(gf * 0.35).toFixed(2)}" text-anchor="middle" font-family="${font}" font-size="${gf}" font-weight="800" fill="${color}">${esc(data.grade)}</text></g>
<line x1="100" y1="16" x2="100" y2="80" stroke="${t.grid}" stroke-width="1"/>
<g transform="translate(114, 26)"><text x="0" y="10" font-family="${font}" font-size="16" font-weight="700" fill="${t.text}">Developer Profile</text><text x="0" y="32" font-family="${font}" font-size="11" fill="${t.text_secondary}">${esc(strengthsLine)}</text><text x="0" y="50" font-family="${font}" font-size="10" letter-spacing="0.4" fill="${t.text_secondary}">Score <tspan fill="${t.text}" font-weight="600">${data.score.toFixed(0)}</tspan> / 100</text></g>
<line x1="20" y1="${statsY-4}" x2="360" y2="${statsY-4}" stroke="${t.grid}" stroke-width="0.5"/>