Skip to content

Commit

Permalink
Swap cubicInterpolationMode removal.
Browse files Browse the repository at this point in the history
Put back monotone, remove default.
  • Loading branch information
dracos committed Feb 23, 2018
1 parent 39c7453 commit a540b0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/controllers/controller.line.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ module.exports = function(Chart) {
function capControlPoint(pt, min, max) {
return Math.max(Math.min(pt, max), min);
}

/*
if (meta.dataset._model.cubicInterpolationMode === 'monotone') {
*/
helpers.splineCurveMonotone(points);
/*
} else {
*/
for (i = 0, ilen = points.length; i < ilen; ++i) {
point = points[i];
model = point._model;
Expand All @@ -267,9 +269,9 @@ module.exports = function(Chart) {
model.controlPointNextX = controlPoints.next.x;
model.controlPointNextY = controlPoints.next.y;
}
/*
}
*/

if (me.chart.options.elements.line.capBezierPoints) {
for (i = 0, ilen = points.length; i < ilen; ++i) {
model = points[i]._model;
Expand Down
4 changes: 2 additions & 2 deletions src/core/core.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ module.exports = function(Chart) {
helpers.aliasPixel = function(pixelWidth) {
return (pixelWidth % 2 === 0) ? 0 : 0.5;
};
/*
helpers.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {
// Props to Rob Spencer at scaled innovation for his post on splining between points
// http://scaledinnovation.com/analytics/splines/aboutSplines.html
Expand Down Expand Up @@ -226,7 +227,7 @@ module.exports = function(Chart) {
}
};
};
/*
*/
helpers.EPSILON = Number.EPSILON || 1e-14;
helpers.splineCurveMonotone = function(points) {
// This function calculates Bézier control points in a similar way than |splineCurve|,
Expand Down Expand Up @@ -319,7 +320,6 @@ module.exports = function(Chart) {
}
}
};
*/
helpers.nextItem = function(collection, index, loop) {
if (loop) {
return index >= collection.length - 1 ? collection[0] : collection[index + 1];
Expand Down

0 comments on commit a540b0e

Please sign in to comment.