Skip to content

Commit 087dd3b

Browse files
committed
Apply fixes.
1 parent 6eb4808 commit 087dd3b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kotify/frappe-charts",
3-
"version": "1.4.1k5",
3+
"version": "1.4.1k6",
44
"description": "https://github.com/kotify/charts",
55
"main": "dist/kotify-charts.min.cjs.js",
66
"module": "dist/kotify-charts.min.esm.js",

src/js/utils/draw-utils.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,15 @@ export function getSplineCurvePointsStr(xList, yList) {
8585

8686
let bezierCommand = (point, i, a) => {
8787
let cps = controlPoint(a[i - 1], a[i - 2], point);
88-
let cpe = controlPoint(point, a[i - 1], a[i + 1], true);
88+
let cpe = controlPoint(point, a[i], a[i + 1], true);
89+
if (isNaN(cpe[0]) || isNaN(cpe[1])) {
90+
cpe = point;
91+
}
8992
return `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`;
9093
};
9194

9295
let pointStr = (points, command) => {
93-
return points.reduce((acc, point, i, a) => i === 0
96+
return points.filter(point => point[1] !== undefined).reduce((acc, point, i, a) => i === 0
9497
? `${point[0]},${point[1]}`
9598
: `${acc} ${command(point, i, a)}`, '');
9699
};

0 commit comments

Comments
 (0)