JSFiddle - React, Tailwind, and code Playground
JavaScript
const clientX = 0;
const shiftX = 0;
const left = 0;
const min = 100;
const max = 200;
const right = 0;
const value = (clientX + shiftX - left) * (max - min) / (right - left);
let newFrom = Math.floor(value) + min;
console.log('value', value); // NaN
console.log('newFrom', newFrom); // NaN