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

Function clamp

src/interaction/createZoomState.ts:73–73  ·  view source on GitHub ↗
(v: number, lo: number, hi: number)

Source from the content-addressed store, hash-verified

71const DEFAULT_MAX_SPAN = 100;
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);

Callers 6

clamp01Function · 0.70
createZoomStateFunction · 0.70
applyNextRangeFunction · 0.70
setSpanConstraintsFunction · 0.70
zoomInFunction · 0.70
zoomOutFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected