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
feat(sampler): add min-max sampler function #19279
Conversation
Thanks for your contribution! Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the |
a15892e
to
77a3723
Compare
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-19279@4a63340 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a great idea. Can you explain what min-max mean first?
Thank you. |
Thanks for your explanation. Can you provide a link or something for further understanding? Is this a concept well-known or you invented it? |
It's my own implementation of the known min-max downsampling algorithm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Please also add test cases in test/line-sampling.html
. Please pay special attention both to the cases where there are negative values or not.
I added the described test cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! This will be released in the next version.
Updated demo here |
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
Brief Information
This pull request is in the type of:
What does this PR do?
Add min-max sampler function
Details
Before: What was the problem?
In some cases min-max sampling algorithm fits line data more naturally than the existing ones. For example, for a sine with a lot of data points min-max sampler is the best choice.
Example.
The original sine without sampling (200 000 data points).
Using 'average' sampler
Using 'lttb' sampler
Using 'max' sampler
Using 'min' sampler
After: How does it behave after the fixing?
Using new 'minmax' sampler
Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information