Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sporto/polylinear-scale
A polylinear scale for Elm
https://github.com/sporto/polylinear-scale
Last synced: about 1 month ago
JSON representation
A polylinear scale for Elm
- Host: GitHub
- URL: https://github.com/sporto/polylinear-scale
- Owner: sporto
- License: other
- Created: 2017-08-09T22:28:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-30T06:14:57.000Z (over 6 years ago)
- Last Synced: 2024-05-09T07:11:25.991Z (8 months ago)
- Language: Elm
- Homepage: http://package.elm-lang.org/packages/sporto/polylinear-scale/latest
- Size: 19.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Elm Polylinear Scale
Create a polylinear scales and map values.
As explained here
Example polylinear scale:
```
[(0, 0), (100, 50), (300, 100)]
```This is a scale that maps one domain to a different one. The first value in the tuple is domain A and the second domain B.
For example given value 100 in domain A you want to know the equivalent in domain B which would be 50.
```elm
scale = polylinearScale [(0, 0), (100, 50), (300, 100)]scale 100 == 50
scale 150 == 62.5
```