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

Updated text size calculation breaks VictoryLegend #2613

Closed
dlabrecq opened this issue Jun 7, 2023 · 4 comments
Closed

Updated text size calculation breaks VictoryLegend #2613

dlabrecq opened this issue Jun 7, 2023 · 4 comments
Labels
Issue: Stale This issue is marked as stale and will close in 14 days

Comments

@dlabrecq
Copy link
Contributor

dlabrecq commented Jun 7, 2023

Describe the bug
The victory-core package changed how text sizes are calculated -- see #2505. However, this appears to have inadvertently affected VictoryLegend. As a result, we can no longer use gutterRow={0} and the lineHeight label style for vertical legends. Unlike gutter={0}, there is always a minimum amount of space between legend rows, which appears based on font size.

Note that the gap between rows increases with larger font sizes. For example, gutterRow={0}and and lineHeight no longer produces the same gap for font size 14 Vs 20.

Victory version
36.6.10

Code Sandbox link
Example with v36.6.8 (expected)
https://codesandbox.io/s/legend-row-gutter-example-1-19qsyb

Example with v36.6.10
https://codesandbox.io/s/legend-row-gutter-example-2-5yn1p4

Example with v36.6.10 and font size 20
https://codesandbox.io/s/legend-row-gutter-example-3-4inypx

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://formidable.com/open-source/victory/docs/victory-legend/#rowgutter
  2. Update gutterRow={0}
  3. See error

Expected behavior
With gutterRow={0} and lineHeight: 0.275, a minimal gap is expected between rows.

Screenshots

Example with v36.6.8 (expected)
Screenshot 2023-06-07 at 8 21 00 PM

Example with v36.6.8 and font size 20 (expected)
Screenshot 2023-06-07 at 9 00 14 PM

Example with v36.6.10
Screenshot 2023-06-07 at 8 22 09 PM

Example with v36.6.10 and font size 20
Screenshot 2023-06-07 at 8 24 56 PM

Desktop (please complete the following information):

  • OS: [Mac]
  • Browser [chrome]
  • Version [113.0.5672.126]

Additional context

@dlabrecq
Copy link
Contributor Author

dlabrecq commented Jun 7, 2023

FYI @EthanRutherford

@dlabrecq dlabrecq changed the title Text size calculation appears to break VictoryLegend rowGutter Updated text size calculation breaks VictoryLegend Jun 8, 2023
@EthanRutherford
Copy link
Contributor

This issue has been addressed in the latest release, please let us know if you encounter further problems!

Copy link
Contributor

This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the Issue: Stale This issue is marked as stale and will close in 14 days label Feb 23, 2024
Copy link
Contributor

github-actions bot commented Mar 1, 2024

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

@github-actions github-actions bot closed this as completed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Stale This issue is marked as stale and will close in 14 days
Projects
None yet
Development

No branches or pull requests

2 participants