(n)
| 771 | svg.appendChild(scoreLabel); |
| 772 | |
| 773 | function setRevealed(n) { |
| 774 | revealed = Math.max(1, Math.min(EVAL_HISTORY.length, n)); |
| 775 | const frac = (revealed - 1) / (EVAL_HISTORY.length - 1); |
| 776 | line.setAttribute("stroke-dashoffset", String(1 - frac)); |
| 777 | dots.forEach((c, i) => { |
| 778 | const isVisible = i < revealed; |
| 779 | const isLast = i === revealed - 1; |
| 780 | c.setAttribute("r", isVisible ? (isLast ? "5.5" : "4.5") : "0"); |
| 781 | }); |
| 782 | const last = EVAL_HISTORY[revealed - 1]; |
| 783 | // Slide the score label |
| 784 | const targetX = xScale(last.iter) + 8; |
| 785 | const targetY = yScale(last.score) + 4; |
| 786 | scoreLabel.setAttribute("x", targetX); |
| 787 | scoreLabel.setAttribute("y", targetY); |
| 788 | scoreLabel.textContent = last.score.toFixed(2); |
| 789 | } |
| 790 | setRevealed(1); |
| 791 | |
| 792 | let revealTimer = null; |
no test coverage detected