MCPcopy Index your code
hub / github.com/microsoft/AI-Engineering-Coach / ScoreRing

Function ScoreRing

src/webview/render.ts:74–88  ·  view source on GitHub ↗
({ score, color, size }: { score: number; color: string; size: number })

Source from the content-addressed store, hash-verified

72}
73
74export function ScoreRing({ score, color, size }: { score: number; color: string; size: number }) {
75 const r = (size - 6) / 2;
76 const c = Math.PI * 2 * r;
77 const offset = c - (score / 100) * c;
78 const fontSize = size > 80 ? 22 : size > 60 ? 20 : 14;
79 return html`
80 <svg class="score-ring" width=${size} height=${size} viewBox=${'0 0 ' + size + ' ' + size}>
81 <circle cx=${size / 2} cy=${size / 2} r=${r} fill="none" stroke="rgba(255,255,255,0.06)" stroke-width="5"/>
82 <circle cx=${size / 2} cy=${size / 2} r=${r} fill="none" stroke=${color} stroke-width="5"
83 stroke-dasharray=${c} stroke-dashoffset=${offset} stroke-linecap="round"
84 transform=${'rotate(-90 ' + size / 2 + ' ' + size / 2 + ')'}/>
85 <text x=${size / 2} y=${size / 2} text-anchor="middle" dominant-baseline="central"
86 fill=${color} font-size=${fontSize} font-weight="700">${score}</text>
87 </svg>`;
88}
89
90export function PctBadge({ pct, label }: { pct: number; label: string }) {
91 if (pct === 0) return html`<span class="trend-badge trend-stable">${label} 0%</span>`;

Callers

nothing calls this directly

Calls 1

htmlFunction · 0.70

Tested by

no test coverage detected