Skip to content

A larger default marginLeft for y axes #1451

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

Open
mbostock opened this issue Apr 15, 2023 · 1 comment · May be fixed by #1722
Open

A larger default marginLeft for y axes #1451

mbostock opened this issue Apr 15, 2023 · 1 comment · May be fixed by #1722
Labels
enhancement New feature or request

Comments

@mbostock
Copy link
Member

The current default of 40px is often too small, requiring a custom marginLeft. Since we don’t automatically increase the left margin based on the tick labels #383, we should increase the default, say to 60px. And likewise marginRight if the y axis uses the right anchor.

We should also consider an even larger default if the y scale is ordinal, since ordinal names tend to be longer than numbers. Perhaps 80px. The same applies to the fy axis.

@mbostock mbostock added the enhancement New feature or request label Apr 15, 2023
@mbostock
Copy link
Member Author

Another consideration is that ordinal scales tend to use the center labelAnchor, which consumes additional margins. So perhaps the default margin could adjust based on whether there is a centered label, too.

Fil added a commit that referenced this issue Jun 25, 2023
alternative to #1714

closes #1451
@Fil Fil linked a pull request Jun 25, 2023 that will close this issue
6 tasks
Fil added a commit that referenced this issue Oct 12, 2023
alternative to #1714

closes #1451
Fil added a commit that referenced this issue Jul 29, 2024
alternative to #1714

closes #1451
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant