https://github.com/antvis/coord
Toolkit for apply point transformations for vector.
https://github.com/antvis/coord
coord coordinate coordinate-systems
Last synced: 6 days ago
JSON representation
Toolkit for apply point transformations for vector.
- Host: GitHub
- URL: https://github.com/antvis/coord
- Owner: antvis
- License: mit
- Created: 2018-09-06T03:10:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-24T05:29:21.000Z (3 months ago)
- Last Synced: 2025-05-06T09:08:23.437Z (8 days ago)
- Topics: coord, coordinate, coordinate-systems
- Language: TypeScript
- Homepage: https://observablehq.com/@antv/wow-antv-coord
- Size: 999 KB
- Stars: 43
- Watchers: 37
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
@antv/coordToolkit for mapping elements of sets into geometric objects. ([demo](https://observablehq.com/@pearmini/antv-coord))

[](https://github.com/antvis/coord/actions)
[](https://coveralls.io/github/antvis/coord?branch=master)
[](https://www.npmjs.com/package/@antv/coord)
[](https://www.npmjs.com/package/@antv/coord)
[](https://www.npmjs.com/package/@antv/coord)## ✨ Features
- **Powerful**: Not only does @antv/coord provide some basic affine transformations(translate, rotate, scale, etc.), it also provide some advanced coordinate system transformations(polar, helix, parallel) and cool fisheye transformations.
- **Fixable**: It is a independent lib which means you can use it with other libs besides [G2](https://github.com/antvis/g2/), such as [D3](https://github.com/d3/d3) to create some awesome charts and animations.
- **Fully embrace TypeScript**: All code are written in TypeScript and complete type definition files are provided.
## 📦 Installation
```bash
$ npm install @antv/coord
```## 🔨 Getting Started
```ts
import { Coordinate, Options } from '@antv/coord';const optons: Options = {
x: 0,
y: 0,
width: 500,
height: 500,
transformations: [['cartesian']]
};const coord = new Coordinate(options);
coord.transform('translate', 10, 10);
coord.map([0.5, 0.5]); // [260, 260]
coord.getSize(); // [500, 500]
coord.getCenter(); // [250, 250]
```## 📎 Links
- [Online Demo](https://observablehq.com/@pearmini/antv-coord)
- [API Reference](./docs/api/README.md)## 📮 Contribution
```bash
$ git clone [email protected]:antvis/coord.git$ cd coord
$ npm i
$ npm t
```Then send a pull request after coding.
## 📄 License
MIT@[AntV](https://github.com/antvis).