MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / streamFrame

Function streamFrame

examples/worker-rendering/main.ts:634–659  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 6

showStatusFunction · 0.85
generateChunkFunction · 0.85
updateTotalPointsDisplayFunction · 0.85
stopStreamingFunction · 0.70
formatNumberFunction · 0.70
appendDataMethod · 0.65

Tested by

no test coverage detected