Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ndabap/lorenz-curve
NOT MAINTAINED Get the lorenz curve of a given data set
https://github.com/ndabap/lorenz-curve
javascript lorenz math statistics
Last synced: 1 day ago
JSON representation
NOT MAINTAINED Get the lorenz curve of a given data set
- Host: GitHub
- URL: https://github.com/ndabap/lorenz-curve
- Owner: ndabAP
- License: mit
- Created: 2018-07-19T05:30:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-30T11:22:35.000Z (over 4 years ago)
- Last Synced: 2024-12-16T07:47:42.058Z (6 days ago)
- Topics: javascript, lorenz, math, statistics
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/lorenz-curve
- Size: 389 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# NOT MAINTAINED lorenz-curve
## Installation
```
npm install lorenz-curve --save
```## API
### `lorenzCurve(data: Number[], precision: Number)`| Parameter | Type | Description |
|-------------|-------------------|-----------------------------------|
| `data` | `Number[]` | Data set |
| `precision` | `Number` | Precision for ratios (default: 2) |## Usage
```js
import lorenzCurve from 'lorenz-curve'
import * as assert from 'assert'const {x, y} = lorenzCurve([3, 4, 5, 5, 18])
assert.deepEqual(x, [0.2, 0.4, 0.6, 0.8, 1])
assert.deepEqual(y, [0.09, 0.2, 0.34, 0.49, 1])
```If you are using `require`, you have to attach `.default`.
## Author
[Julian Claus](https://www.julian-claus.de) and contributors.
## License
MIT