# @antv/coord

> Toolkit for mapping elements of sets into geometric objects.

Latest version **0.4.7** (published 2023-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @antv/coord
pnpm add @antv/coord
yarn add @antv/coord
bun add @antv/coord
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.7 |
| Published | 2023-11-23 |
| First published | 2018-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 286.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 44 |
| Author | AntV |
| Maintainers | lvisei, yisi.wang, basketduck, biupiubiupiu, flash1, dreammy23, laixingui.lxg, zhangjunjie-loki, rainy25ghz, zeyuwang, yanxiong, susiwen8, freestyle21, soundquiet, elaine.q.10, sturuby, sakuya223, serializedowen, xdzhao, yangzhanmei, wjgogogo, leungwensen, dori, iaaron, yard, simaq, dxq613, intchous, susan_ann, jinke.li, lzxue, army8735, atool, baizn, dengfuping, neoddish, jeffy2012, zqlu, afc163, pomelo-nwu, kopiluwaky, ccnuzindex, panyuqi, bubkoo, zengyue, kasmine, boyu.zlj, l1ud0ngq1, newbyvector, winniexing, chenluli, kn9117, xdddst, semious2020, esora, nadia_liu, bbsqq, mxz96102, openwayne, pearmini, pddpd, yiqianyao, zhanba, cxxxxxn, xcf(-_-), siqishen, boyyangzai |
| Keywords | coordinate, transformation, visualization |

## Links

- npm: https://www.npmjs.com/package/@antv/coord
- Repository: https://github.com/antvis/coord
- Homepage: https://github.com/antvis/coord#readme
- Issues: https://github.com/antvis/coord/issues
- npm.io page: https://npm.io/package/@antv/coord

## Dependencies (3)

- [gl-matrix](https://npm.io/package/gl-matrix.md) ^3.4.3
- [@antv/util](https://npm.io/package/@antv/util.md) ^2.0.13
- [@antv/scale](https://npm.io/package/@antv/scale.md) ^0.4.12

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.4.7 (latest) — 2023-11-23
- 0.3.0-beta.1 (beta) — 2020-05-12
- 0.4.6 — 2023-08-16
- 0.4.5 — 2023-08-04
- 0.4.4 — 2022-08-19
- 0.4.3 — 2022-03-25
- 0.4.2 — 2022-03-25
- 0.4.1 — 2022-03-11
- 0.4.0 — 2021-06-03
- 0.4.0-beta.3 — 2021-06-03
- 0.4.0-beta.2 — 2021-06-03
- 0.4.0-beta.1 — 2021-06-01
- 0.3.1 — 2021-03-10
- 0.3.0 — 2020-05-12
- 0.2.7 — 2020-04-10
- … 10 more at https://npm.io/package/@antv/coord/versions

## README

<h1 align="center">
<b>@antv/coord</b>
</h1>
<div align="center">

Toolkit for mapping elements of sets into geometric objects. ([demo](https://observablehq.com/@pearmini/antv-coord))

![examples](https://gw.alipayobjects.com/mdn/rms_026665/afts/img/A*3jseR7EZEBwAAAAAAAAAAAAAARQnAQ)

[![Build Status](https://github.com/antvis/coord/workflows/build/badge.svg?branch=master)](https://github.com/antvis/coord/actions)
[![Coverage Status](https://img.shields.io/coveralls/github/antvis/coord/master.svg)](https://coveralls.io/github/antvis/coord?branch=master)
[![npm Version](https://img.shields.io/npm/v/@antv/coord.svg)](https://www.npmjs.com/package/@antv/coord)
[![npm Download](https://img.shields.io/npm/dm/@antv/coord.svg)](https://www.npmjs.com/package/@antv/coord)
[![npm License](https://img.shields.io/npm/l/@antv/coord.svg)](https://www.npmjs.com/package/@antv/coord)

</div>

## ✨ 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.

![bubbles](https://gw.alipayobjects.com/mdn/rms_026665/afts/img/A*G5jIQLRQ86QAAAAAAAAAAAAAARQnAQ)

## 📦 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 git@github.com:antvis/coord.git

$ cd coord

$ npm i

$ npm t
```

Then send a pull request after coding.

## 📄 License

MIT@[AntV](https://github.com/antvis).

---
_Source: https://npm.io/package/@antv/coord · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
