@figliolia/rn-donut-chart
Version:
An animated donut/pie chart library
17 lines (14 loc) • 395 B
text/typescript
export class Interpolation<T extends string | number> {
outputRange: T[];
inputRange: number[];
constructor(...range: T[]) {
this.outputRange = range;
this.inputRange = Array.from(range, (_, i) => i);
}
public add(value: T) {
return new Interpolation(...this.outputRange, value);
}
public get toValue() {
return this.inputRange[this.inputRange.length - 1];
}
}