Skip to content

Commit

Permalink
docs(linear): add polymap usage (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini committed May 13, 2021
1 parent 3ed6cb3 commit c007e28
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/api/scales/linear.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ x.invert(1000); // 100
x.invert(500); // 0
```

- Poly map

```ts
import { Linear } from '@antv/scale';

const x = new Linear({
domain: [0, 5, 10],
range: [0, 50, 1000],
})

x.map(0); // 0
x.map(4); // 40
x.map(50); // 50
x.map(6); // 240
x.map(10); // 1000
```

- Nice domain

```ts
Expand Down

0 comments on commit c007e28

Please sign in to comment.