Skip to content

antvis/coord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
May 18, 2021
May 18, 2021
May 25, 2021
Nov 23, 2023
Aug 19, 2022
Nov 23, 2023
May 18, 2021
May 18, 2021
May 18, 2021
May 18, 2021
May 18, 2021
Jun 4, 2021
Nov 23, 2023
Aug 16, 2021
Feb 24, 2025

Repository files navigation

@antv/coord

Toolkit for mapping elements of sets into geometric objects. (demo)

examples

Build Status Coverage Status npm Version npm Download npm License

โœจ 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, such as 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

๐Ÿ“ฆ Installation

$ npm install @antv/coord

๐Ÿ”จ Getting Started

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

๐Ÿ“ฎ Contribution

$ git clone git@github.com:antvis/coord.git

$ cd coord

$ npm i

$ npm t

Then send a pull request after coding.

๐Ÿ“„ License

MIT@AntV.