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

Function zoomOut

src/interaction/createZoomState.ts:260–271  ·  view source on GitHub ↗
(center, factor)

Source from the content-addressed store, hash-verified

258 };
259
260 const zoomOut: ZoomState['zoomOut'] = (center, factor) => {
261 if (!Number.isFinite(center) || !Number.isFinite(factor)) return;
262 if (factor <= 1) return;
263
264 const c = clamp(center, 0, 100);
265 const span = end - start;
266 const r = span === 0 ? 0.5 : clamp01((c - start) / span);
267 const nextSpan = span * factor;
268 const nextStart = c - r * nextSpan;
269 const nextEnd = nextStart + nextSpan;
270 applyNextRange(nextStart, nextEnd, { anchor: { center: c, ratio: r } });
271 };
272
273 const pan: ZoomState['pan'] = (delta) => {
274 if (!Number.isFinite(delta)) return;

Callers

nothing calls this directly

Calls 3

applyNextRangeFunction · 0.85
clampFunction · 0.70
clamp01Function · 0.70

Tested by

no test coverage detected