# ml-xy-convert

> Convert between different xy formats

Latest version **1.0.0** (published 2018-02-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install ml-xy-convert
pnpm add ml-xy-convert
yarn add ml-xy-convert
bun add ml-xy-convert
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-02-11 |
| First published | 2018-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Miguel Asencio |
| Maintainers | jeffersonh44, lpatiny, maasencioh, stropitek, targos |

## Links

- npm: https://www.npmjs.com/package/ml-xy-convert
- Repository: https://github.com/mljs/xy-convert
- Homepage: https://github.com/mljs/xy-convert#readme
- Issues: https://github.com/mljs/xy-convert/issues
- npm.io page: https://npm.io/package/ml-xy-convert

## Recent versions

- 1.0.0 (latest) — 2018-02-11
- 0.1.0 — 2018-02-11

## README

# xy-convert

  [![NPM version][npm-image]][npm-url]
  [![build status][travis-image]][travis-url]
  [![Test coverage][codecov-image]][codecov-url]
  [![npm download][download-image]][download-url]

Convert between different xy formats.

## Installation

`$ npm install --save ml-xy-convert`

## Usage

```js
import xyConvert from 'ml-xy-convert';

const xxyyArray = [[1, 1, 1], [2, 2, 2]];
const xxyyObject = { x: [1, 1, 1], y: [2, 2, 2] };
const xyxyArray = [[1, 2], [1, 2], [1, 2]];
const xyxyObject = [{ x: 1, y: 2 }, { x: 1, y: 2 }, { x: 1, y: 2 }];

xyConvert(xxyyArray) === xxyyObject;
xyConvert(xxyyArray, { inputFormat: 'xxyyArray' }) === xxyyObject;
xyConvert(xxyyArray, { outputFormat: 'xyxyObject' }) === xyxyObject;
```

## [API Documentation](https://mljs.github.io/xy-convert/)
Structure convention
  * xyxyArray: `[[x1, y1], [x2, y2], ... ]`
  * xxyyArray: `[[x1, x2, ...], [y1, y2, ...]]`
  * xyxyObject: `[{x: x1, y: y1}, {x: x2, y: y2}, ...]`
  * xxyyObject: `{x:[x1, x2, ...], y:[y1, y2, ...]}`

## License

  [MIT](./LICENSE)

[npm-image]: https://img.shields.io/npm/v/ml-xy-convert.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/ml-xy-convert
[travis-image]: https://img.shields.io/travis/mljs/xy-convert/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/mljs/xy-convert
[codecov-image]: https://img.shields.io/codecov/c/github/mljs/xy-convert.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/mljs/xy-convert
[download-image]: https://img.shields.io/npm/dm/ml-xy-convert.svg?style=flat-square
[download-url]: https://www.npmjs.com/package/ml-xy-convert

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