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

Function getPointXY

src/ChartGPU.ts:161–164  ·  view source on GitHub ↗
(p: DataPoint)

Source from the content-addressed store, hash-verified

159const isTupleOHLCDataPoint = (p: OHLCDataPoint): p is OHLCDataPointTuple => Array.isArray(p);
160
161const getPointXY = (p: DataPoint): { readonly x: number; readonly y: number } => {
162 if (isTupleDataPoint(p)) return { x: p[0], y: p[1] };
163 return { x: p.x, y: p.y };
164};
165
166const getOHLCTimestamp = (p: OHLCDataPoint): number => (isTupleOHLCDataPoint(p) ? p[0] : p.timestamp);
167const getOHLCClose = (p: OHLCDataPoint): number => (isTupleOHLCDataPoint(p) ? p[2] : p.close);

Callers 4

computeRawBoundsFromDataFunction · 0.70
computeGlobalBoundsFunction · 0.70
buildPayloadFunction · 0.70

Calls 1

isTupleDataPointFunction · 0.70

Tested by

no test coverage detected