nl_tokens: / * Maps a value between [ 0 -- max ] back into [ minRange -- maxRange ] . The target range can be a floating point number .
pl_tokens: function ( val , max ) { var $this = this ; var rangeMin = $this . data ( 'range_min' ) ; var rangeMax = $this . data ( 'range_max' ) ; if ( val <= 0 ) { return rangeMin ; } if ( val >= max ) { return rangeMax ; } // // To do this we first map 0 -- max relatively withing [minRange // and maxRange], that is between [0 and (maxRange-minRange)]. // var relativeMapping = ( rangeMax - rangeMin ) * val / <mask> ; // ... then we bring this to the actual value by adding rangeMin. return relativeMapping + rangeMin ; }