Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bernardobelchior
Copy link
Member

@bernardobelchior bernardobelchior commented Aug 15, 2025

Related to #18999.

Handle domain edge cases with filterMode: 'discard'.

Screen.Recording.2025-08-15.at.15.42.47.mov

A consequence of this change is that we'll now render the axis line when there's no data:

image

If that isn't acceptable, we can add a special case for it.

@bernardobelchior bernardobelchior added type: bug It doesn't behave as expected. scope: charts Changes related to the charts. labels Aug 15, 2025
@mui-bot
Copy link

mui-bot commented Aug 15, 2025

Deploy preview: https://deploy-preview-19199--material-ui-x.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 🔺+1B(0.00%)
@mui/x-charts 🔺+183B(+0.06%) 🔺+71B(+0.07%)
@mui/x-charts-pro 🔺+183B(+0.05%) 🔺+83B(+0.07%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 🔺+1B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against bdd4bb4

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 15, 2025

CodSpeed Performance Report

Merging #19199 will improve performances by 8.62%

Comparing bernardobelchior:handle-domain-edge-cases (bdd4bb4) with master (3f4237d)1

Summary

⚡ 1 improvements
✅ 9 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
ScatterChartPro with big data amount 437.8 ms 403.1 ms +8.62%

Footnotes

  1. No successful run was found on master (fa7749e) during the generation of this report, so 3f4237d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Comment on lines 82 to 84
const skipAxisRendering = position === 'none';
const skipTickRendering =
(isScaleBand && domain.length === 0) || (!isScaleBand && domain.some(isInfinity));
Copy link
Member

Choose a reason for hiding this comment

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

Can't we simply revert all these axis changes? It seems unnecessary, and would technically create a breaking change, wouldn't it simply work as it currently does if we remove them?

Copy link
Member Author

@bernardobelchior bernardobelchior Sep 9, 2025

Choose a reason for hiding this comment

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

It isn't unnecessary.

Without it, a zoomed area without any data points will hide the axis:

Screen.Recording.2025-09-09.at.08.57.51.mov

With it, only the ticks will be hidden. The axis will still render:

Screen.Recording.2025-09-09.at.08.58.17.mov

would technically create a breaking change

That's true, but I think we can work around that. I'll try to see what I can do.

@zannager zannager changed the title [charts-pro] Handle domain edge cases with filterMode: 'discard' [charts] Handle domain edge cases with filterMode: 'discard' Aug 28, 2025
@github-actions
Copy link

github-actions bot commented Sep 9, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 9, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 9, 2025
Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

Just a small comment on the formatting for the edge case

@bernardobelchior bernardobelchior merged commit 6a8a320 into mui:master Sep 10, 2025
22 checks passed
@bernardobelchior bernardobelchior deleted the handle-domain-edge-cases branch September 10, 2025 13:17
JCQuintas pushed a commit to JCQuintas/mui-x that referenced this pull request Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan: Pro Impact at least one Pro user. scope: charts Changes related to the charts. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants