Created
May 15, 2024 16:25
-
-
Save jlozovei/a21241de40613eee8303c0d12104fa7e to your computer and use it in GitHub Desktop.
Create a 0-100 scale with x and y values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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