UNPKG

rheostat

Version:

Rheostat is a www, mobile, and accessible slider component built with React

10 lines (8 loc) 225 B
export default { getPosition(x, min, max) { return ((max / (max - min)) ** 0.5) * (((x - min) / max) ** 0.5) * 100; }, getValue(x, min, max) { return (Math.round(((x / 100) ** 2) * (max - min)) + min); }, };