Package Exports
- d3-interpolate-curve
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (d3-interpolate-curve) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
d3-interpolate-curve
This module provides a select of methods for generating number value interpolators from D3 curve functions.
Installing
If you use NPM, npm install d3-interpolate-curve
.
Otherwise, download the latest release.
Alternativly in vanilla JS:
<script src="https://raw.githack.com/jamesleesaunders/d3-interpolate-curve/dist/d3-interpolate.js"></script>
<script>
var interpolate = d3.interpolateFromCurve([1,2,7,2], d3.curveMonotoneX, 0.00001, 100);
</script>
API Reference
# d3.interpolateFromCurve(values, curve, epsilon, samples) · Source, Examples
Returns interpolator based on D3 curve function; d3.curveCardinal(), d3.curveLinear(), d3.curveMonotoneX() etc.
var interpolate = d3.interpolateFromCurve([1,2,7,2], d3.curveMonotoneX, 0.00001, 100);
# d3.interpolateCardinal(values) · Source, Examples
Returns interpolator based on cubic Cardinal spline.
var interpolate = d3.interpolateCardinal([1,2,7,2]);
# d3.interpolateCatmullRom(values) · Source, Examples
Returns interpolator based on a cubic Catmull–Rom spline.
var interpolate = d3.interpolateCatmullRom([1,2,7,2]);
# d3.interpolateMonotoneX(values) · Source, Examples
Returns interpolator based on MonotoneX spline.
var interpolate = d3.interpolateMonotoneX([1,2,7,2]);
Credits
- Andreas Plesch - hugh credit for goes to Andreas who came up with the original concept for this module.
- Mike Bostock - for advice on converting SVG curves.