Skip to content
Merged
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
5 changes: 0 additions & 5 deletions src/coord/scaleRawExtentInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,6 @@ export class ScaleRawExtentInfo {
(min == null || !isFinite(min)) && (min = NaN);
(max == null || !isFinite(max)) && (max = NaN);

if (min > max) {
min = NaN;
max = NaN;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change looks good in the example. Are there any concerns at the time we adding this logic @100pah

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

#15910 seems to state another potential enhancement where min is identical to max.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just consider that if min is set to be bigger than max, it does not make sense to display the chart.

Copy link
Copy Markdown
Member Author

@plainheart plainheart Oct 20, 2021

Choose a reason for hiding this comment

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

I agree. But the NaN value brought an unexpected behavior. Maybe it's not a good idea to change here.

Copy link
Copy Markdown
Contributor

@pissang pissang Oct 20, 2021

Choose a reason for hiding this comment

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

I think we can remove NaN logic here. Then think about how should we handle the case when min/max are invalid.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@100pah So should we merge this PR and keep improving in further PRs?

}

const isBlank = eqNaN(min)
|| eqNaN(max)
|| (isOrdinal && !axisDataLen);
Expand Down
42 changes: 41 additions & 1 deletion test/axis-filter-extent2.html

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