MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getBounds

Function getBounds

src/ui-react-dom-charts/common/data.ts:171–185  ·  view source on GitHub ↗
(kind: Kind, points: DataPoint[])

Source from the content-addressed store, hash-verified

169 : mathRound(((size * (value - min)) / (max - min)) * 1000000) / 1000000;
170
171export const getBounds = (kind: Kind, points: DataPoint[]): Bounds => {
172 if (arrayIsEmpty(points)) {
173 return [];
174 }
175 const [yMin, yMax] = getYDomain(points, kind);
176
177 if (arrayIsEmpty(arrayFilter(points, ([, xValue]) => !isNumber(xValue)))) {
178 const [xMin, xMax] = getDomain(
179 arrayMap(points, ([, xValue]) => xValue as number),
180 );
181 return [xMin, xMax, yMin, yMax];
182 }
183
184 return [points[0]?.[1], points[size(points) - 1]?.[1], yMin, yMax];
185};
186
187export const getYTicks = (
188 [, , yMin, yMax]: Bounds,

Callers 1

getSeriesSummaryFunction · 0.70

Calls 7

arrayIsEmptyFunction · 0.90
arrayFilterFunction · 0.90
isNumberFunction · 0.90
arrayMapFunction · 0.90
sizeFunction · 0.90
getYDomainFunction · 0.70
getDomainFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…