normalize
Commons
stable
Re-maps a number from one numeric range to another. First normalises to [0, 1] relative to the current scale, then projects onto the new scale.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- numberrequisnumber
- The value to re-map.
- currentScaleMinrequisnumber
- The lower bound of the input range.
- currentScaleMaxrequisnumber
- The upper bound of the input range.
- newScaleMinnumber0
- The lower bound of the output range. Defaults to 0.
- newScaleMaxnumber1
- The upper bound of the output range. Defaults to 1.
API
Valeur de retour
La valeur retournée par cet util.
- The re-mapped value in [newScaleMin, newScaleMax].
Usage
Exemples
Extraits de code prêts à coller.
Map a slider value to an opacity