{"id":19267004,"url":"https://github.com/mljs/array-utils","last_synced_at":"2025-06-14T07:38:19.695Z","repository":{"id":34082561,"uuid":"37901653","full_name":"mljs/array-utils","owner":"mljs","description":"Some array utilities in JavaScript","archived":false,"fork":false,"pushed_at":"2017-11-28T13:22:38.000Z","size":150,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-12T04:46:48.365Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mljs.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-23T06:35:15.000Z","updated_at":"2019-10-17T22:22:40.000Z","dependencies_parsed_at":"2022-07-18T01:10:50.052Z","dependency_job_id":null,"html_url":"https://github.com/mljs/array-utils","commit_stats":null,"previous_names":["mljs/arrayutils"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/mljs/array-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Farray-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Farray-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Farray-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Farray-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mljs","download_url":"https://codeload.github.com/mljs/array-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Farray-utils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259777920,"owners_count":22909753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T20:09:14.623Z","updated_at":"2025-06-14T07:38:19.674Z","avatar_url":"https://github.com/mljs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ArrayUtils\n\n  [![NPM version][npm-image]][npm-url]\n  [![build status][travis-image]][travis-url]\n  [![David deps][david-image]][david-url]\n  [![npm download][download-image]][download-url]\n\n## Installation\n\n`$ npm install ml-array-utils`\n\n## Methods\n\n### coordArrayToPoints(array, dimensions) \n\nFunction that returns an array of points given 1D array as follows:\n\n`[x1, y1, .. , x2, y2, ..]`\n\nAnd receive the number of dimensions of each point.\n\n### uniqueX(xs, ys)\n\nIn place modification of the 2 arrays to make X unique and sum the Y if X has the same value\n\n * @param xs\n * @param ys\n\nAnd receive the number of dimensions of each point.\n\n\n__Arguments__\n\n* `array` - 1D array\n* `dimensions` - number of dimensions that has each point.\n\n### coordArrayToCoordMatrix(array, dimensions) \n\nFunction that given an array as follows:\n\n`[x1, y1, .. , x2, y2, ..]`\n\nReturns an array as follows:\n\n`[[x1, x2, ..], [y1, y2, ..], [ .. ]]`\n\nAnd receives the number of dimensions of each coordinate.\n\n__Arguments__\n\n* `array` - 1D array\n* `dimensions` - number of dimensions that has each point.\n\n### coordMatrixToCoordArray(coordMatrix)\n\nFunction that receives a coordinate matrix as follows:\n\n`[[x1, x2, ..], [y1, y2, ..], [ .. ]]`\n\nReturns an array of coordinates as follows:\n\n`[x1, y1, .. , x2, y2, ..]`\n\n__Arguments__\n\n* `coordMatrix` - Coordinate matrix\n\n### coordMatrixToPoints\n\nFunction that receives a coordinate matrix as follows:\n\n`[[x1, x2, ..], [y1, y2, ..], [ .. ]]`\n\nReturns an array of points.\n\n__Arguments__\n\n* `coordMatrix` - Coordinate matrix\n\n### pointsToCoordArray(points)\n\nFunction that transform an array of points into a coordinates array as follows:\n\n`[x1, y1, .. , x2, y2, ..]`\n\n__Arguments__\n\n* `points` - Coordinate matrix\n\n### pointsToCoordMatrix(points)\n\nFunction that recieve an array of points and returns a coordinates matrix as follows:\n\n`[[x1, x2, ..], [y1, y2, ..], [ .. ]]`\n\n__Arguments__\n\n* `points` - Coordinate matrix\n\n### applyDotProduct(firstVector, secondVector)\n\nApply the dot product between the smaller vector and a subsets of the\nlargest one, returns an array with all the results of each dot product.\n\n__Arguments__\n\n* `firstVector` - Array\n* `secondVector` - Array\n\n### getEquallySpacedData(x, y, options)\n\nFunction that returns a Number array of equally spaced numberOfPoints\ncontaining a representation of intensities of the spectra arguments x\nand y.\n\nThe options parameter contains an object in the following form:\nfrom: starting point\nto: last point\nnumberOfPoints: number of points between from and to\nvariant: \"slot\" or \"smooth\" - smooth is the default option\n\nThe slot variant consist that each point in the new array is calculated\naveraging the existing points between the slot that belongs to the current\nvalue. The smooth variant is the same but takes the integral of the range\nof the slot and divide by the step size between two points in the new array.\n\n__Arguments__\n\n* `x` - Array of positions in the x axis.\n* `y` - Array of positions in the y axis.\n* `options` - Options in the way described.\n\n### SNV(data)\n\nFunction that applies the standard normal variate (SNV) to an array of values.\n\n__Arguments__\n\n* `data` - array of values.\n\n## Authors\n\n- [Jefferson Hernandez](https://github.com/JeffersonH44)\n\n## License\n\n[MIT](./LICENSE)\n  \n[npm-image]: https://img.shields.io/npm/v/ml-array-utils.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/ml-array-utils\n[travis-image]: https://img.shields.io/travis/mljs/array-utils/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/mljs/array-utils\n[david-image]: https://img.shields.io/david/mljs/array-utils.svg?style=flat-square\n[david-url]: https://david-dm.org/mljs/array-utils\n[download-image]: https://img.shields.io/npm/dm/ml-array-utils.svg?style=flat-square\n[download-url]: https://npmjs.org/package/ml-array-utils","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Farray-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmljs%2Farray-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Farray-utils/lists"}