linear-scale
v0.0.3
Published
Linear scale function.
Downloads
1,744
Readme
linear-scale
Linear scale function
Install
npm install linear-scale
Usage
var LinearScale = require('linear-scale')
var scale = LinearScale().domain([0, 100]).range([1000, 10000])
// shorthand
var scale = LinearScale([0, 100], [1000, 10000])
console.log(scale(0)) // 1000
console.log(scale(100)) // 10000
console.log(scale(50)) // 5500
console.log(scale(200)) // 19000
console.log(scale(-100)) // -8000
Test
npm test