Spaces:
Running
Running
Jimin Huang
commited on
Commit
·
01d8559
1
Parent(s):
a60d5fe
Change settings
Browse files
src/components/CompareChartE.vue
CHANGED
|
@@ -138,13 +138,20 @@ async function composeBadge(agent, model, color = '#666') {
|
|
| 138 |
canvas.width = S; canvas.height = S;
|
| 139 |
const ctx = canvas.getContext('2d');
|
| 140 |
|
| 141 |
-
//
|
|
|
|
|
|
|
|
|
|
| 142 |
ctx.fillStyle = color;
|
| 143 |
ctx.beginPath(); ctx.arc(R, R, R, 0, Math.PI * 2); ctx.fill();
|
| 144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
// agent logo (fit into inner circle)
|
| 146 |
if (aImg) {
|
| 147 |
-
drawImageInCircle(ctx, aImg, R, R, R -
|
| 148 |
}
|
| 149 |
|
| 150 |
// model puck (bottom-right)
|
|
|
|
| 138 |
canvas.width = S; canvas.height = S;
|
| 139 |
const ctx = canvas.getContext('2d');
|
| 140 |
|
| 141 |
+
const ring = 3; // outer colored ring thickness
|
| 142 |
+
const padImg = 4; // extra breathing room for the logo
|
| 143 |
+
|
| 144 |
+
// base colored circle (ring)
|
| 145 |
ctx.fillStyle = color;
|
| 146 |
ctx.beginPath(); ctx.arc(R, R, R, 0, Math.PI * 2); ctx.fill();
|
| 147 |
|
| 148 |
+
// inner white disk
|
| 149 |
+
ctx.fillStyle = '#fff';
|
| 150 |
+
ctx.beginPath(); ctx.arc(R, R, R - ring, 0, Math.PI * 2); ctx.fill();
|
| 151 |
+
|
| 152 |
// agent logo (fit into inner circle)
|
| 153 |
if (aImg) {
|
| 154 |
+
drawImageInCircle(ctx, aImg, R, R, R - ring, { mode: 'contain', padding: padImg });
|
| 155 |
}
|
| 156 |
|
| 157 |
// model puck (bottom-right)
|