Skip to content

Commit

Permalink
Remove unused variable (tidy-up, unrelated to the main issue)
Browse files Browse the repository at this point in the history
Issue 4686
Explicitly check for single isolated points when creating paths for
'straight' and 'smooth' curves. Curve type 'monotoneCubic' already
does this intrinsically due to the different algorithm employed.
  • Loading branch information
rosco54 committed Sep 20, 2024
1 parent 1c743a3 commit 91e3dc3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/charts/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,6 @@ class Line {
curve,
isRangeStart,
}) {
let w = this.w
let graphics = new Graphics(this.ctx)
const areaBottomY = this.areaBottomY
let rangeArea = type === 'rangeArea'
Expand Down Expand Up @@ -952,6 +951,13 @@ class Line {
}
areaPath = graphics.move(pX, pY)

// Check for single isolated point
if (series[i][j + 1] === null) {
linePaths.push(linePath);
areaPaths.push(areaPath);
// Stay in pathState = 0;
break
}
pathState = 1
if (j < series[i].length - 2) {
let p = graphics.curve(pX + length, pY, x - length, y, x, y)
Expand Down Expand Up @@ -1034,6 +1040,13 @@ class Line {
}
areaPath = graphics.move(pX, pY)

// Check for single isolated point
if (series[i][j + 1] === null) {
linePaths.push(linePath);
areaPaths.push(areaPath);
// Stay in pathState = 0
break
}
pathState = 1
if (j < series[i].length - 2) {
let p = pathToPoint(curve, x, y)
Expand Down

0 comments on commit 91e3dc3

Please sign in to comment.