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

Function attachCoalescedResizeObserver

examples/live-streaming/main.ts:61–72  ·  view source on GitHub ↗
(container: HTMLElement, chart: ChartGPUInstance)

Source from the content-addressed store, hash-verified

59});
60
61const attachCoalescedResizeObserver = (container: HTMLElement, chart: ChartGPUInstance): ResizeObserver => {
62 let rafId: number | null = null;
63 const ro = new ResizeObserver(() => {
64 if (rafId !== null) return;
65 rafId = requestAnimationFrame(() => {
66 rafId = null;
67 chart.resize();
68 });
69 });
70 ro.observe(container);
71 return ro;
72};
73
74const createSeedData = (count: number): DataPoint[] => {
75 const n = Math.max(2, Math.floor(count));

Callers 1

mainFunction · 0.70

Calls 1

resizeMethod · 0.65

Tested by

no test coverage detected