Want to skip to the implementation? Check out these examples:
The API below described how to use the logarithmic-interpolator features.
By default, react-ranger uses linear interpolation between data points, but allows you to easily customize it to use your own interpolation functions by passing an object that implements the following interface.
interpolator: {
getPercentageForValue: (val: number, min: number, max: number): number;
getValueForClientX: (clientX: number, trackDims: object, min: number, max: number): number;
}
interpolator: {
getPercentageForValue: (val: number, min: number, max: number): number;
getValueForClientX: (clientX: number, trackDims: object, min: number, max: number): number;
}
The Interpolator to use. Defaults to the bundled linear-scale interpolator
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.