13 Commits

Author SHA1 Message Date
Johannes Kronmüller
207fe8f66e
fix: decimation plugin data not writeable after clean (#11045) 2023-02-10 07:45:43 +02:00
Dan Onoshko
51441272a7
refactor: move to esm in sources (#10879) 2022-11-17 08:08:44 -05:00
Evert Timberg
d3a9bf375c
Allow individual chart controllers to opt-in to the decimation plugin (#10182)
* Allow individual chart controllers to opt-in to the decimation plugin

* Code review feedback
2022-02-21 08:33:33 -05:00
Atharva Deshpande
30e66bc50e
Fix: Typo 'is less' -> 'are lesser' (#9755)
* Fix: Typo 'is less' -> 'are lesser'

* Update plugin.decimation.js
2021-10-16 22:41:27 +03:00
Jukka Kurkela
066130be4d
Decimation: Prevent buffer overflow (#9367) 2021-07-07 17:45:31 -04:00
Nico-DF
b4dee5507c
Adding threshold option to decimation plugin (#9327) 2021-07-04 13:19:35 -04:00
Nico-DF
5a27de32da
Setting correct decimated values when below threshold (#8883)
* Setting correct decimated values when below threshold
* Using existing function for cleaning decimated data
* Cleaning decimated only on current dataset
* Reordering decimation clean to avoid allocation
2021-04-12 09:08:39 -04:00
Nico-DF
ba3320ef19
Filtering data before decimation (#8843)
* Filtering data before decimation

Using only points between the currently displayed x-axis for the decimation algorithm.
Allows better resolution, especially if using a zoom

If data are outside range, they will not be displayed, hence the line graph will not show the trend at extremities

* Fix LTTB algorithm

* Adding test file

* Simplifying count algorithm for decimation plugin
2021-04-07 16:40:45 -04:00
Evert Timberg
bdfaa44ab3
Correct decimation plugin documentation (#8801)
* Correct decimation plugin documentation

* The default for decimation is `false`.
* Added a sample for data decimation
* Corrected an issue in the decimation plugin when switched from enabled to disabled
2021-04-03 13:06:31 -04:00
Evert Timberg
5c9e1d578c
LTTB Decimation (#8468)
* LTTB Decimation
* Lint fixes
2021-02-21 09:15:45 -05:00
Evert Timberg
709dc3e854
Decimation plugin fixes (#8467)
* fix: Decimation plugin no longer changes the data order
fix: Decimation plugin no longer duplicates data points

* Use nullOrUndef helper instead of direct check

* Compute averageX value when decimating data using minMax decimation

* Place last point of interval at real X

This reduces the fuzziness on screens with devicePixelRatio > 1
2021-02-20 15:01:21 -05:00
Jukka Kurkela
ddfbcf777a
Update eslint-config-chartjs to v0.3.0 (#8406) 2021-02-10 08:21:39 -05:00
Evert Timberg
650956b2e1
Create a new hook to enable data decimation (#8255)
* Create a new hook to enable data decimation

The `beforeElementUpdate` hook can be used to decimate data. The chart
elements will not be created until after this hook has fired ensuring that
if decimation occurs, only the needed elements will be created.

* Address code review feedback

* Rename hook to beforeElementsUpdate

* Simplify parsing logic

* Add decimation plugin to the core

* Allow a dataset to specify a different data key

* Decimation plugin uses the dataKey feature

* Refactor the decimation plugin to support configurable algorithms

* Lint the plugin changes

* Tests for the dataKey feature

* Convert test files to tabs

* Standardize on tabs in ts files

* Remove the dataKey feature

* Replace dataKey usage in decimation plugin

We define a new descriptor for the `data` key allowing the
plugin to be simpler.

* Disable decimation when indexAxis is Y

* Simplify the decimation width approximation

* Resolve the indexAxis correctly in all cases

* Initial documentation

* Reverse check

* Update TS definitions for new plugin options

* Move defineProperty after bailouts

* Add destroy hook
2021-02-01 16:37:32 -05:00