Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/graph-types/polyline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/graphs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}

Expand Down