Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/latentflip/scales
https://github.com/latentflip/scales
Last synced: 30 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/latentflip/scales
- Owner: latentflip
- Created: 2014-03-11T23:07:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-10-19T02:42:10.000Z (about 5 years ago)
- Last Synced: 2024-10-07T13:49:28.065Z (about 1 month ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Scales
Quantitative scales, [as found in d3](https://github.com/mbostock/d3/wiki/Quantitative-Scales).
Currently implemented the basics of linear and power scales, as per [the d3 docs](https://github.com/mbostock/d3/wiki/Quantitative-Scales).
```javascript
var scales = require('scales');var scale = scales.linear()
.domain([-100, 100]) //input domain
.range([0, 10]); //output rangescale(-100) // -> 0
scale(0) // -> 5
scale(100) // -> 10
```# License
MIT