ml-array-xy-filter-x

1.0.2 • Public • Published

array-xy-filter-x

NPM version npm download

Sort a set of point based on the abscissas values.

Installation

$ npm install --save ml-array-xy-filter-x

Usage

import filterX from 'ml-array-xy-filter-x';

  const x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  const y = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
  const points = { x, y };

let result = filterX(points, {
    from: 2.5,
    to: 8.5,
    exclusions: [{ from: 2, to: 4.5 }, { from: 5.5, to: 8 }]
});

/* result -> {
    x: [5, 8],
    y: [6, 9]
} */

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ml-array-xy-filter-x

Weekly Downloads

68

Version

1.0.2

License

MIT

Unpacked Size

15.2 kB

Total Files

10

Last publish

Collaborators

  • stropitek
  • targos
  • lpatiny
  • mljs-bot