(count: number)
| 72 | }; |
| 73 | |
| 74 | const createSeedData = (count: number): DataPoint[] => { |
| 75 | const n = Math.max(2, Math.floor(count)); |
| 76 | const out: DataPoint[] = new Array(n); |
| 77 | for (let i = 0; i < n; i++) { |
| 78 | const x = i * 0.02; |
| 79 | const y = Math.sin(x) * 0.8 + Math.sin(x * 0.23 + 1.2) * 0.25; |
| 80 | out[i] = [x, y] as const; |
| 81 | } |
| 82 | return out; |
| 83 | }; |
| 84 | |
| 85 | async function main(): Promise<void> { |
| 86 | const container = document.getElementById('chart'); |