array-xy-max-merge

1.0.0 • Public • Published

array-xy-max-merge

NPM version npm download

Merge abscissa values on similar ordinates and keeps the abscissa with bigger ordinate value.

Installation

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

Usage

import maxMerge from 'array-xy-max-merge';

const points = {
    x: [100.001, 100.002, 200.01, 200.02, 300.0001, 300.0002],
    y: [10, 11, 20, 21, 30, 31]
};

const merged = maxMerge(points, {groupWidth: 0.010001});
/*
merged.x -> [100.002, 200.02, 300.0002];
merged.y -> [21, 41, 61];
*/

License

MIT

/array-xy-max-merge/

    Package Sidebar

    Install

    npm i array-xy-max-merge

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • targos
    • lpatiny
    • cheminfo-bot
    • stropitek
    • maasencioh