(from: number, to: number)
| 38 | ]; |
| 39 | |
| 40 | const arcPath = (from: number, to: number) => { |
| 41 | const a1 = valToAngle(from); |
| 42 | const a2 = valToAngle(to); |
| 43 | const p1 = polar(a1, r); |
| 44 | const p2 = polar(a2, r); |
| 45 | const large = Math.abs(a1 - a2) > Math.PI ? 1 : 0; |
| 46 | return `M ${p1.x} ${p1.y} A ${r} ${r} 0 ${large} 1 ${p2.x} ${p2.y}`; |
| 47 | }; |
| 48 | |
| 49 | // Needle |
| 50 | const needleAngle = valToAngle(Math.max(0, Math.min(100, score))); |
no test coverage detected