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

Function computeZoomInOutAnchorRatio

src/ChartGPU.ts:691–695  ·  view source on GitHub ↗
(range: ZoomRange, center: number)

Source from the content-addressed store, hash-verified

689 };
690
691 const computeZoomInOutAnchorRatio = (range: ZoomRange, center: number): number => {
692 const span = range.end - range.start;
693 if (!Number.isFinite(span) || span === 0) return 0.5;
694 return clamp((center - range.start) / span, 0, 1);
695 };
696
697 const createCoordinatorZoomStateLike = (): ZoomState => {
698 const getRange: ZoomState['getRange'] = () => coordinator?.getZoomRange() ?? { start: 0, end: 100 };

Callers 2

zoomInFunction · 0.85
zoomOutFunction · 0.85

Calls 1

clampFunction · 0.70

Tested by

no test coverage detected