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

Function generateBatch

examples/worker-streaming/main.ts:66–78  ·  view source on GitHub ↗

* Generate batch of test data

(startX: number, count: number)

Source from the content-addressed store, hash-verified

64 * Generate batch of test data
65 */
66function generateBatch(startX: number, count: number): ReadonlyArray<DataPoint> {
67 const batch: DataPoint[] = new Array(count);
68 for (let i = 0; i < count; i++) {
69 const x = startX + i * 0.01;
70 const y =
71 Math.sin(x * 0.5) * 0.6 +
72 Math.sin(x * 1.3) * 0.3 +
73 Math.sin(x * 3.7) * 0.15 +
74 (Math.random() - 0.5) * 0.05;
75 batch[i] = [x, y] as const;
76 }
77 return batch;
78}
79
80/**
81 * FPS tracker

Callers 1

streamFrameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected