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

Function clamp01

src/interaction/createZoomState.ts:74–74  ·  view source on GitHub ↗
(v: number)

Source from the content-addressed store, hash-verified

72
73const clamp = (v: number, lo: number, hi: number): number => Math.min(hi, Math.max(lo, v));
74const clamp01 = (v: number): number => clamp(v, 0, 1);
75
76const normalizeZero = (v: number): number => (Object.is(v, -0) ? 0 : v);
77

Callers 3

applyNextRangeFunction · 0.70
zoomInFunction · 0.70
zoomOutFunction · 0.70

Calls 1

clampFunction · 0.70

Tested by

no test coverage detected