From 6462f25aa6d3690fdeeda5fd54f43f108ae379fd Mon Sep 17 00:00:00 2001 From: Linho Date: Wed, 21 May 2025 13:42:06 +0800 Subject: [PATCH 1/2] Fix #342 polyline disappear when yAxis inverted --- src/graph-types/polyline.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/graph-types/polyline.ts b/src/graph-types/polyline.ts index 06d671b..45656b1 100644 --- a/src/graph-types/polyline.ts +++ b/src/graph-types/polyline.ts @@ -18,6 +18,11 @@ export default function polyline(chart: Chart) { const yRange = chart.meta.yScale.range() let yMax = yRange[0] let yMin = yRange[1] + + // Fix #342 + // When yAxis is reversed, the yRange is inverted, i.e. yMin > yMax + if (yMin > yMax) [yMin, yMax] = [yMax, yMin] + // workaround, clamp assuming that the bounds are finite but huge const diff = yMax - yMin yMax += diff * 1e6 From 6224cd288bbd1749618c7981fe6428d19357e555 Mon Sep 17 00:00:00 2001 From: Linho Date: Sat, 24 May 2025 14:48:37 +0800 Subject: [PATCH 2/2] Make async tests wait longer --- test/e2e/graphs.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/graphs.test.ts b/test/e2e/graphs.test.ts index 29d20cc..b1b591d 100644 --- a/test/e2e/graphs.test.ts +++ b/test/e2e/graphs.test.ts @@ -45,7 +45,7 @@ describe('Function Plot', () => { // This adds an artificial spin only on functions that are labeled with [async] if (snippet.testName.indexOf('[async]') >= 0) { await new Promise((resolve) => { - setTimeout(resolve, 100) + setTimeout(resolve, 3000) }) }