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

Function createChart

examples/annotations/main.ts:267–282  ·  view source on GitHub ↗
(useWorker: boolean)

Source from the content-addressed store, hash-verified

265 };
266
267 const createChart = async (useWorker: boolean): Promise<void> => {
268 // Prevent re-entrancy + accidental double-clicks during async init.
269 modeToggle.setEnabled(false);
270 try {
271 disposeChart();
272
273 chart = useWorker
274 ? await ChartGPU.createInWorker(container, options)
275 : await ChartGPU.create(container, options);
276
277 ro = attachCoalescedResizeObserver(container, chart);
278 chart.resize();
279 } finally {
280 modeToggle.setEnabled(true);
281 }
282 };
283
284 // Default to main-thread mode.
285 modeToggle.setChecked(false);

Callers 3

mainFunction · 0.70
onToggleChangeFunction · 0.70
initFunction · 0.50

Calls 4

createMethod · 0.80
disposeChartFunction · 0.70
resizeMethod · 0.65

Tested by

no test coverage detected