()
| 632 | let nextX = state.totalPointsGenerated; |
| 633 | |
| 634 | const streamFrame = (): void => { |
| 635 | if (!state.streaming || !state.chart || frameCount >= streamDuration) { |
| 636 | stopStreaming(); |
| 637 | showStatus('Streaming complete', 'success'); |
| 638 | return; |
| 639 | } |
| 640 | |
| 641 | frameCount++; |
| 642 | |
| 643 | // Generate batch |
| 644 | const batch = generateChunk(nextX, streamRate, dataType); |
| 645 | nextX += streamRate; |
| 646 | |
| 647 | // Append to chart |
| 648 | state.chart.appendData(0, batch); |
| 649 | |
| 650 | state.totalPointsGenerated += streamRate; |
| 651 | |
| 652 | // Update live point count display (throttled) |
| 653 | updateTotalPointsDisplay(state.totalPointsGenerated); |
| 654 | |
| 655 | showStatus( |
| 656 | `Streaming... ${frameCount}/${streamDuration} frames (${formatNumber(state.totalPointsGenerated)} points total)`, |
| 657 | 'warning' |
| 658 | ); |
| 659 | }; |
| 660 | |
| 661 | // Start streaming at ~60fps |
| 662 | state.streamingIntervalId = window.setInterval(streamFrame, 16); |
nothing calls this directly
no test coverage detected