From e5a832f3a0f554bfde13c9780fc942920eb85425 Mon Sep 17 00:00:00 2001 From: Luc Patiny Date: Sun, 3 Nov 2024 07:10:04 +0100 Subject: [PATCH] fix: check first and last point for xyGrowingX (#264) --- src/xy/xyGrowingX.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xy/xyGrowingX.ts b/src/xy/xyGrowingX.ts index 4dd35ecf..6f9efd50 100644 --- a/src/xy/xyGrowingX.ts +++ b/src/xy/xyGrowingX.ts @@ -11,7 +11,7 @@ export function xyGrowingX(data: DataXY): DataXY { throw new TypeError('length of x and y must be identical'); } - if (x.length < 2 || x[0] < x[1]) return data; + if (x.length < 2 || x[0] < x[x.at(-1) as number]) return data; return { x: x.slice(0).reverse(),