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

Function recreateCoordinator

examples/million-points/main.ts:391–411  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

389 };
390
391 const recreateCoordinator = (): void => {
392 if (!gpuContext) return;
393 const prevZoom = coordinator?.getZoomRange() ?? null;
394
395 coordinator?.dispose();
396 coordinator = createRenderCoordinator(gpuContext, resolvedOptions, {
397 onRequestRender: requestRender,
398 });
399 coordinatorTargetFormat = gpuContext.preferredFormat;
400
401 // Best-effort preserve zoom window.
402 if (prevZoom) coordinator.setZoomRange(prevZoom.start, prevZoom.end);
403
404 unsubscribeZoom?.();
405 unsubscribeZoom = coordinator.onZoomRangeChange((r) => {
406 zoomRange = { start: r.start, end: r.end };
407 });
408 zoomRange = coordinator.getZoomRange();
409
410 syncSliderUi();
411 };
412
413 // Coalesced resize observer (keeps canvas backing size in sync without DOM thrash).
414 const ro = (() => {

Callers 2

resizeCanvasAndConfigureFunction · 0.70
mainFunction · 0.70

Calls 6

createRenderCoordinatorFunction · 0.90
syncSliderUiFunction · 0.85
onZoomRangeChangeMethod · 0.80
getZoomRangeMethod · 0.65
disposeMethod · 0.65
setZoomRangeMethod · 0.65

Tested by

no test coverage detected