1.0.2 • Published 3 years ago
ml-array-xy-sort-x v1.0.2
array-xy-sort-x
Sort a set of point based on the abscissas values.
Installation
$ npm install --save ml-array-xy-sort-x
Usage
import sortX from 'ml-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]
} */