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

[charts] Improve axis size docs #16673

Merged
merged 8 commits into from
Feb 21, 2025
Merged

Conversation

JCQuintas
Copy link
Member

  • Updated the styling.md file to include explanations of the new axis size properties and how they affect chart layout.

@JCQuintas JCQuintas added docs Improvements or additions to the documentation component: charts This is the name of the generic UI component, not the React module! labels Feb 20, 2025
@JCQuintas JCQuintas self-assigned this Feb 20, 2025
@mui-bot
Copy link

mui-bot commented Feb 20, 2025

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

Updated pages:

Generated by 🚫 dangerJS against 2ffb75c

Copy link

codspeed-hq bot commented Feb 20, 2025

CodSpeed Performance Report

Merging #16673 will not alter performance

Comparing JCQuintas:improve-axis-size-docs (2ffb75c) with master (b949938)

Summary

✅ 6 untouched benchmarks

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.

Nice one. I proposed to split the explaination a bit differently to avoid some confusion about the fact we could be able to compute the axis size


You might want to modify those values to leave more space for your axis ticks or reduce them to provide more space for the data.
To define the axis size, you can use the `xAxis` and `yAxis` configuration. The size is only take into account if the axis has a position different from `none`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
To define the axis size, you can use the `xAxis` and `yAxis` configuration. The size is only take into account if the axis has a position different from `none`.
The axes have a default size.
To update it, use the `xAxis` and `yAxis` configuration as follow:

Copy link
Member

Choose a reason for hiding this comment

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

Should it be "as follows" instead of "as follow"?

Comment on lines 158 to 160
- **`y-axis`**: Uses the `width` prop instead.

{{"demo": "MarginNoSnap.js", "hideToolbar": true, "bg": "playground"}}
Copy link
Member

@alexfauquette alexfauquette Feb 21, 2025

Choose a reason for hiding this comment

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

I propose to move this note after the demo to avoid creating confusion for the reader

Suggested change
- **`y-axis`**: Uses the `width` prop instead.
{{"demo": "MarginNoSnap.js", "hideToolbar": true, "bg": "playground"}}
- **`y-axis`**: Uses the `width` prop instead.
Axes that should not be displayed (for example those with `position: 'none'`) are ignored.
{{"demo": "MarginNoSnap.js", "hideToolbar": true, "bg": "playground"}}
Suggested change
- **`y-axis`**: Uses the `width` prop instead.
{{"demo": "MarginNoSnap.js", "hideToolbar": true, "bg": "playground"}}
- **`y-axis`**: Uses the `width` prop instead.
Axes that should not be displayed (for example those with `position: 'none'`) do not take up any space, regardless of their size.
{{"demo": "MarginNoSnap.js", "hideToolbar": true, "bg": "playground"}}

Copy link
Member

Choose a reason for hiding this comment

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

By

Axes that should not be displayed (for example those with position: 'none') are ignored.

do we mean that axes that should not be displayed will ignore the size they're given?

If so, I suppose the following formulation might be clearer: "Axes that should not be displayed (for example those with position: 'none') do not take up any space, regardless of their size."

What do you think?

JCQuintas and others added 2 commits February 21, 2025 11:33
Co-authored-by: Bernardo Belchior <[email protected]>
Signed-off-by: Jose C Quintas Jr <[email protected]>
@JCQuintas
Copy link
Member Author

I've re-written some of your suggestions to what I feel make them clearer, but let me know what you think of the re-wording 😄

Copy link
Member

@bernardobelchior bernardobelchior left a comment

Choose a reason for hiding this comment

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

Minor suggestions, looks good!

JCQuintas and others added 3 commits February 21, 2025 12:11
Co-authored-by: Bernardo Belchior <[email protected]>
Signed-off-by: Jose C Quintas Jr <[email protected]>
Co-authored-by: Bernardo Belchior <[email protected]>
Signed-off-by: Jose C Quintas Jr <[email protected]>
@JCQuintas JCQuintas merged commit 9d60897 into mui:master Feb 21, 2025
18 of 19 checks passed
@JCQuintas JCQuintas deleted the improve-axis-size-docs branch February 21, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants