Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering data before decimation #8843

Merged
merged 4 commits into from Apr 7, 2021
Merged

Filtering data before decimation #8843

merged 4 commits into from Apr 7, 2021

Conversation

Nico-DF
Copy link
Contributor

@Nico-DF Nico-DF commented Apr 7, 2021

fixes #8833

  • Duplication of the getStartAndCountOfVisiblePoints function as the _sorted is not initialized yet but in our case, we know by design that the parsing is disabled
  • Adapt min-max and lttb algorithm to start with an offset
  • Fix error on LTTB algorithm
  • Added simple tests to only count points on LTTB algorithm

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
Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, mostly nit's.

src/plugins/plugin.decimation.js Outdated Show resolved Hide resolved
src/plugins/plugin.decimation.js Show resolved Hide resolved
src/plugins/plugin.decimation.js Outdated Show resolved Hide resolved
src/plugins/plugin.decimation.js Outdated Show resolved Hide resolved
src/plugins/plugin.decimation.js Outdated Show resolved Hide resolved
@etimberg etimberg merged commit ba3320e into chartjs:master Apr 7, 2021
@etimberg etimberg added this to the Version 3.1 milestone Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chart 3 & Data Decimation
3 participants