@trodi/range-buckets
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

range-buckets Build Status

Create nice buckets for a given range of data.

This splits a data range into n number of smaller ranges or "buckets". You can use this to create sub-filters for data. The algorithms used are based on how Excel produces smart chart axis.

Microsoft Article ID: 214075

Install

npm install @trodi/range-buckets

Usage

Code:

import * as Buckets from "range-buckets";
Buckets.getBuckets(0, 100, 3);

Output:

[ { min: 0, max: 40, },
  { min: 40, max: 80, },
  { min: 80, max: 120 } ]

Note that the number of buckets returned may be fewer than requested.

Build

npm run build

Publish

  • npm version <patch|minor|major>
  • npm publish --access public
  • Commit and push changes to git

License

MIT License

Readme

Keywords

Package Sidebar

Install

npm i @trodi/range-buckets

Weekly Downloads

51

Version

1.0.1

License

MIT

Unpacked Size

8.06 kB

Total Files

5

Last publish

Collaborators

  • trodi