victory icon indicating copy to clipboard operation
victory copied to clipboard

Updated text size calculation breaks VictoryLegend

Open dlabrecq opened this issue 1 year ago • 2 comments

Describe the bug The victory-core package changed how text sizes are calculated -- see https://github.com/FormidableLabs/victory/pull/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 avatar Jun 07 '23 23:06 dlabrecq

FYI @EthanRutherford

dlabrecq avatar Jun 07 '23 23:06 dlabrecq

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

EthanRutherford avatar Jun 13 '23 00:06 EthanRutherford

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[bot] avatar Feb 23 '24 21:02 github-actions[bot]

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[bot] avatar Mar 01 '24 22:03 github-actions[bot]