Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```