(kind: Kind, points: DataPoint[])
| 169 | : mathRound(((size * (value - min)) / (max - min)) * 1000000) / 1000000; |
| 170 | |
| 171 | export 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 | |
| 187 | export const getYTicks = ( |
| 188 | [, , yMin, yMax]: Bounds, |
no test coverage detected
searching dependent graphs…