array-xy-centroids-merge

0.1.0 • Public • Published

array-xy-centroids-merge

NPM version npm download

Merge abscissa values if the ordinate value is in a list of centroids.

Installation

$ npm install --save array-xy-ranges-merge

Usage

import mergeByCentroids from 'array-xy-centroids-merge';

const originalPoints = {
    x: [0.01, 1.008, 1.010, 1.012, 1.02, 1.04],
    y: [1, 1, 1, 1, 1, 1]
};

mergeByCentroids(originalPoints, [1.01, 1.04])

/* result -> {
    x: [1.01, 1.04],
    y: [3, 1]
} */

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i array-xy-centroids-merge

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • maasencioh