xy-convert
Convert between different xy formats.
Installation
$ npm install --save ml-xy-convert
Usage
; 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 ; === xxyyObject; === xxyyObject; === xyxyObject;
API Documentation
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, ...]}