MCPcopy Create free account
hub / github.com/aptabase/aptabase / Chart

Function Chart

src/webapp/components/Chart.tsx:43–55  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

41};
42
43export function Chart(props: Props) {
44 const canvasRef = useRef<HTMLCanvasElement>(null);
45 let chartRef: ChartJS | undefined;
46
47 useEffect(() => {
48 if (!canvasRef.current) return;
49
50 chartRef = new ChartJS(canvasRef.current, props.config);
51 return () => chartRef?.destroy();
52 }, [canvasRef, props.config]);
53
54 return <canvas ref={canvasRef} />;
55}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected