Normalises numbers. Return values will be in the range of 0-1 (inclusive).
ixfx Guide on Normalising
Use streamWithContext if you want to be able to check the min/max or reset the normaliser.
const s = Normalise.stream(`minmax`);s(2); // 1 (because 2 is highest seen)s(1); // 0 (because 1 is the lowest so far)s(1.5); // 0.5 (50% of range 1-2)s(0.5); // 0 (because it's the new lowest) Copy
const s = Normalise.stream(`minmax`);s(2); // 1 (because 2 is highest seen)s(1); // 0 (because 1 is the lowest so far)s(1.5); // 0.5 (50% of range 1-2)s(0.5); // 0 (because it's the new lowest)
For more details, see:
Normalises numbers. Return values will be in the range of 0-1 (inclusive).
ixfx Guide on Normalising
Use streamWithContext if you want to be able to check the min/max or reset the normaliser.