1 | <h1 align="center">
|
2 | <b>@antv/coord</b>
|
3 | </h1>
|
4 |
|
5 | <div align="center">
|
6 |
|
7 | Toolkit for mapping elements of sets into geometric objects.
|
8 |
|
9 | [![Build Status](https://github.com/antvis/coord/workflows/build/badge.svg?branch=master)](https://github.com/antvis/coord/actions)
|
10 | [![Coverage Status](https://img.shields.io/coveralls/github/antvis/coord/master.svg)](https://coveralls.io/github/antvis/coord?branch=master)
|
11 | [![npm Version](https://img.shields.io/npm/v/@antv/coord.svg)](https://www.npmjs.com/package/@antv/coord)
|
12 | [![npm Download](https://img.shields.io/npm/dm/@antv/coord.svg)](https://www.npmjs.com/package/@antv/coord)
|
13 | [![npm License](https://img.shields.io/npm/l/@antv/coord.svg)](https://www.npmjs.com/package/@antv/coord)
|
14 |
|
15 | </div>
|
16 |
|
17 | ## ✨ Features
|
18 |
|
19 | - **Powerful**
|
20 | - **High performance**
|
21 | - **Fully embrace TypeScript**
|
22 |
|
23 | ## 📦 Installation
|
24 |
|
25 | ```bash
|
26 | $ npm install @antv/coord
|
27 | ```
|
28 |
|
29 | ## 🔨 Getting Started
|
30 |
|
31 | ```ts
|
32 | import { Coordinate, Options } from '@antv/coord';
|
33 |
|
34 | const optons: Options = {
|
35 | x: 0,
|
36 | y: 0,
|
37 | width: 500,
|
38 | height: 500,
|
39 | transformations: [['cartesian']]
|
40 | };
|
41 |
|
42 | const coord = new Coordinate(options);
|
43 | coord.transform('translate', 10, 10);
|
44 | coord.map([0.5, 0.5]); // [260, 260]
|
45 | coord.getSize(); // [500, 500]
|
46 | coord.getCenter(); // [250, 250]
|
47 | ```
|
48 |
|
49 | ## 📎 Links
|
50 |
|
51 | - [Introduction](https://observablehq.com/@pearmini/antv-coord)
|
52 | - [API Reference](./docs/api/README.md)
|
53 |
|
54 | ## 📮 Contribution
|
55 |
|
56 | ```bash
|
57 | $ git clone git@github.com:antvis/coord.git
|
58 |
|
59 | $ cd coord
|
60 |
|
61 | $ npm i
|
62 |
|
63 | $ npm t
|
64 | ```
|
65 |
|
66 | Then send a pull request after coding.
|
67 |
|
68 | ## 📄 License
|
69 |
|
70 | MIT@[AntV](https://github.com/antvis).
|