Normalize the ratio of a number in a range
JavaScript version
const normalizeRatio = (value, min, max) => (value - min) / (max - min);
TypeScript version
const normalizeRatio = (value: number, min: number, max: number): number => (value - min) / (max - min);