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

Function isHit

src/interaction/findPointsAtX.ts:192–198  ·  view source on GitHub ↗
(xCenterRange: number)

Source from the content-addressed store, hash-verified

190 let hitIndex = -1;
191
192 const isHit = (xCenterRange: number): boolean => {
193 if (!Number.isFinite(xCenterRange)) return false;
194 const left = xCenterRange + offsetLeftFromCategoryCenter;
195 const right = left + barWidth;
196 // Expanded interval: [left - tol, right + tol)
197 return xValue >= left - hitTol && xValue < right + hitTol;
198 };
199
200 if (seriesHasNaNX(data, isTuple)) {
201 // NaN breaks ordering; linear scan for correctness.

Callers 1

findPointsAtXFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected