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

Function isBodyHitAt

src/interaction/findCandlestick.ts:213–225  ·  view source on GitHub ↗
(p: OHLCDataPoint)

Source from the content-addressed store, hash-verified

211 };
212
213 const isBodyHitAt = (p: OHLCDataPoint): boolean => {
214 const open = getOpen(p);
215 const close = getClose(p);
216 if (!Number.isFinite(open) || !Number.isFinite(close)) return false;
217
218 const yOpen = yScale.scale(open);
219 const yClose = yScale.scale(close);
220 if (!Number.isFinite(yOpen) || !Number.isFinite(yClose)) return false;
221
222 const yMin = Math.min(yOpen, yClose);
223 const yMax = Math.max(yOpen, yClose);
224 return y >= yMin && y <= yMax;
225 };
226
227 for (let s = 0; s < series.length; s++) {
228 const cfg = series[s];

Callers 1

findCandlestickFunction · 0.85

Calls 3

getOpenFunction · 0.85
getCloseFunction · 0.70
scaleMethod · 0.65

Tested by

no test coverage detected