ml-array-rescale
Rescale an array into a range
Last updated 10 years ago by targos .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install ml-array-rescale 
SYNC missed versions from official npm registry.

array-rescale

NPM version npm download

Rescale an array into a range.

Installation

$ npm install --save ml-array-rescale

Usage

rescale(input[, options])

Rescales the values in the input so they fit between two new values.

Options:

  • min: the new minimum value (default: 0)
  • max: the new maximum value (default: 1)
  • output: an array to use for output. You can pass input here to get an in-place modification.
import rescale from 'ml-array-rescale';

const result = rescale([0, 1, 2, 3, 4]);
// [0, 0.25, 0.5, 0.75, 1]

License

MIT

Current Tags

  • 2.0.0                                ...           latest (7 months ago)

17 Versions

  • 2.0.0                                ...           7 months ago
  • 1.3.7                                ...           5 years ago
  • 1.3.6                                ...           5 years ago
  • 1.3.5                                ...           6 years ago
  • 1.3.4                                ...           6 years ago
  • 1.3.3                                ...           6 years ago
  • 1.3.2                                ...           6 years ago
  • 1.3.1                                ...           7 years ago
  • 1.3.0                                ...           7 years ago
  • 1.2.2                                ...           7 years ago
  • 1.2.1                                ...           8 years ago
  • 1.2.0                                ...           8 years ago
  • 1.1.1                                ...           8 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 60
Today 0
This Week 8
This Month 39
Last Day 0
Last Week 18
Last Month 11
Dependencies (2)
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE