array-xy-sort-x
v0.1.0
Published
Sort a set of point based on the abscissas values
Downloads
3
Readme
array-xy-sort-x
Sort a set of point based on the abscissas values.
Installation
$ npm install --save array-xy-sort-x
Usage
import sortX from 'array-xy-sort-x';
const x = [6, 5, 4, 3, 2, 1, 0, -1];
const y = [17, 16, 15, 14, 13, 12, 11, 10];
sortX({x, y});
/* result -> {
x: [-1, 0, 1, 2, 3, 4, 5, 6],
y: [10, 11, 12, 13, 14, 15, 16, 17]
} */