# chartjs-plugin-responsive-downsample

> A chart.js plugin to dynamically downsample line chart data depending on the chart resolution.

Latest version **1.1.3** (published 2019-01-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install chartjs-plugin-responsive-downsample
pnpm add chartjs-plugin-responsive-downsample
yarn add chartjs-plugin-responsive-downsample
bun add chartjs-plugin-responsive-downsample
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2019-01-07 |
| First published | 2018-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 82.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Marcel Pursche |
| Maintainers | jklimke, marcel.pursche |

## Links

- npm: https://www.npmjs.com/package/chartjs-plugin-responsive-downsample
- Repository: https://github.com/3dcl/chartjs-plugin-responsive-downsample
- Homepage: https://github.com/3dcl/chartjs-plugin-responsive-downsample#readme
- Issues: https://github.com/3dcl/chartjs-plugin-responsive-downsample/issues
- npm.io page: https://npm.io/package/chartjs-plugin-responsive-downsample

## Dependencies (3)

- [chart.js](https://npm.io/package/chart.js.md) ^2.7.3
- [typescript](https://npm.io/package/typescript.md) ^2.9.2
- [@types/chart.js](https://npm.io/package/@types/chart.js.md) ^2.7.42

## Recent versions

- 1.1.3 (latest) — 2019-01-07
- 1.1.2 — 2018-10-25
- 1.1.1 — 2018-07-30
- 1.1.0 — 2018-05-30
- 1.0.8 — 2018-04-17
- 1.0.7 — 2018-04-17
- 1.0.6 — 2018-03-28
- 1.0.5 — 2018-03-28
- 1.0.4 — 2018-03-28

## README

chartjs-plugin-responsive-downsample
====================================
[![Build Status](https://travis-ci.com/3dcl/chartjs-plugin-responsive-downsample.svg?branch=master)](https://travis-ci.com/3dcl/chartjs-plugin-responsive-downsample)

A chart.js plugin to dynamically downsample line chart data depending on the chart resolution.
The plugin creates a mipmap-like data structure from line chart data and dynamically choses a downsampled version of the data depending on the chart resolution and x axis scale.

Inspired by: [AlbinoDrought/chartjs-plugin-downsample](https://github.com/AlbinoDrought/chartjs-plugin-downsample)

### Installation

```bash
$ npm install chartjs-plugin-responsive-downsample
```

### Configuration
```javascript
{
    options: {
        responsiveDownsample: {
            enabled: true,
            /**
             * Choose aggregation algorithm 'AVG'(Average values) or
             * 'LTTB' (Largest-Triangle-Three-Buckets). Default: 'LTTB'
             */
            aggregationAlgorithm: 'LTTB',
            /**
             * The desired minimal distance between data points in pixels.
             * The plugin downsamples the data and tries to match this threshold.
             * Default: 1 pixel
             */
            desiredDataPointDistance: 1,
            /**
             * The minimal number of data points. The chart data is not downsampled further than
             * this threshold. Default: 100
             */
            minNumPoints: 100,
             /**
              * Cull data to displayed range of x scale. Default: true
              */
            cullData: boolean;
        }
    }
}
```

---
_Source: https://npm.io/package/chartjs-plugin-responsive-downsample · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
