sveinn-steinarsson/flot-downsample

Downsample plugin for Flot charts.

331

stars

52

commits

JavaScript

primary language

Jun 25, 2024

updated

algorithm
downsample
flot
javascript
time-series
timeseries

README

flot-downsample: Downsample plugin for Flot

This plugin for Flot charts downsamples data before rendering the chart. The purpose is to try retain the visual characteristics of the original line using considerably fewer data points. The algorithm (called Largest-Triangle-Three-Buckets or LTTB) used in this plugin is described in a Master's thesis (see hdl.handle.net/1946/15343) in Computer Science by Sveinn Steinarsson at the University of Iceland. The topic of the thesis is how to downsample time series for visual representation and was initially suggested by DataMarket. JavaScript optimization was done with the help of Borgar Þorsteinsson.

Status

The Flot library is not commonly used nowadays, but the LTTB (Largest-Triangle-Three-Buckets) algorithm remains popular and is well-established for downsampling chart data.

For using LTTB in other libraries or frameworks, you can refer to the LTTB adapted for other programming languages or frameworks section.

Demo

Demo can viewed at base.is/flot/.

Additional demo concerning chart resizing is also available at base.is/flot/resize/

Usage

series: {
  downsample: {
    threshold: 1000 // 0 disables downsampling for this series.
  }
}

Known limitations

  • Does not support gaps (null values) in the data array.
  • X-values must be in a strictly increasing order.

The algorithm (LTTB) adapted for other programming languages or frameworks

Note: I have not tested all these versions and some might have different or additional features.

(Please let me know if you make your own port of the LTTB algorithm so I can list it here.)

License

flot-downsample is released under the terms of the MIT License.

Contributors

Jubke

2 commits

javiljoen

1 commits

bramp

1 commits

sveinn-steinarsson/flot-downsample

Downsample plugin for Flot charts.

331

stars

52

commits

JavaScript

primary language

Jun 25, 2024

updated

algorithm
downsample
flot
javascript
time-series
timeseries

README

flot-downsample: Downsample plugin for Flot

This plugin for Flot charts downsamples data before rendering the chart. The purpose is to try retain the visual characteristics of the original line using considerably fewer data points. The algorithm (called Largest-Triangle-Three-Buckets or LTTB) used in this plugin is described in a Master's thesis (see hdl.handle.net/1946/15343) in Computer Science by Sveinn Steinarsson at the University of Iceland. The topic of the thesis is how to downsample time series for visual representation and was initially suggested by DataMarket. JavaScript optimization was done with the help of Borgar Þorsteinsson.

Status

The Flot library is not commonly used nowadays, but the LTTB (Largest-Triangle-Three-Buckets) algorithm remains popular and is well-established for downsampling chart data.

For using LTTB in other libraries or frameworks, you can refer to the LTTB adapted for other programming languages or frameworks section.

Demo

Demo can viewed at base.is/flot/.

Additional demo concerning chart resizing is also available at base.is/flot/resize/

Usage

series: {
  downsample: {
    threshold: 1000 // 0 disables downsampling for this series.
  }
}

Known limitations

  • Does not support gaps (null values) in the data array.
  • X-values must be in a strictly increasing order.

The algorithm (LTTB) adapted for other programming languages or frameworks

Note: I have not tested all these versions and some might have different or additional features.

(Please let me know if you make your own port of the LTTB algorithm so I can list it here.)

License

flot-downsample is released under the terms of the MIT License.

Contributors

Jubke

2 commits

javiljoen

1 commits

bramp

1 commits

Languages

JavaScript

58.4%

HTML

26.5%

CSS

15.1%