Skip to content

Instantly share code, notes, and snippets.

@jlozovei
Created May 15, 2024 16:25
Show Gist options
  • Save jlozovei/a21241de40613eee8303c0d12104fa7e to your computer and use it in GitHub Desktop.
Save jlozovei/a21241de40613eee8303c0d12104fa7e to your computer and use it in GitHub Desktop.
Create a 0-100 scale with x and y values
const factor = (value - min) / (max - min);
/*
value: 30, min: 30, max: 60
factor: 0
---
value: 1000, min: 500, max: 1500
factor: 0.5
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment