BinMapper¶
Overview¶
BinMapper is an object that maps a continuous value to one of a finite number of "bins".
@author John Blanco (PhET Interactive Simulations)
Class BinMapper¶
Constructor¶
new BinMapper( valueRange : Range, numBins : number, providedOptions? : BinMapperOptions )¶
Instance Methods¶
mapToBin( value : number ) : number¶
Map the provided value to a bin.
Type BinMapperOptions¶
- tolerateOutOfRangeValues?: boolean
Allow values that are outside the specified range (if false, an assert occurs on out-of-range values).
Source Code¶
See the source for BinMapper.ts in the tambo repository.