Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

linear-scale

miguelmota1.4kMIT0.0.3

Linear scale function.

scale, linear

readme

linear-scale

Linear scale function

NPM

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

License

MIT

changelog

Change Log

All notable changes to this project will be documented in this file.

This project adheres to Semantic Versioning.