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

changed weakFilter logic, so line charts will not disappear, while zoom #18202

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/component/dataZoom/AxisProxy.ts
Skuperday marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Author

Choose a reason for hiding this comment

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

add the new version of implement, that don't generate errors on eslinter

Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,16 @@ class AxisProxy {
for (let i = 0; i < dataDims.length; i++) {
const value = store.get(dataDimIndices[i], dataIndex) as number;
const thisHasValue = !isNaN(value);
const thisLeftOut = value < valueWindow[0];
const thisRightOut = value > valueWindow[1];
let thisRightOut = value > valueWindow[1];
let thisLeftOut = value < valueWindow[0];
if (seriesModel.subType !== 'bar') {
const parsedRightValue = seriesData.get(dataDims[i], dataIndex + 1);
const parsedLeftValue = seriesData.get(dataDims[i], dataIndex - 1);
const leftValue = (typeof parsedLeftValue === 'number') ? parsedLeftValue : NaN;
const rightValue = (typeof parsedRightValue === 'number') ? parsedRightValue : NaN;
thisLeftOut = thisLeftOut && leftValue < valueWindow[0];
thisRightOut = thisRightOut && rightValue > valueWindow[1];
}
if (thisHasValue && !thisLeftOut && !thisRightOut) {
return true;
}
Expand Down
141 changes: 141 additions & 0 deletions test/axis-weak-filter.html
Copy link
Author

Choose a reason for hiding this comment

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

just test case that demonstrate diff in logic under weakFilter and without it

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.