victory
victory copied to clipboard
Updated text size calculation breaks VictoryLegend
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:
- Go to https://formidable.com/open-source/victory/docs/victory-legend/#rowgutter
- Update
gutterRow={0}
- 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)
Example with v36.6.8 and font size 20 (expected)
Example with v36.6.10
Example with v36.6.10 and font size 20
Desktop (please complete the following information):
- OS: [Mac]
- Browser [chrome]
- Version [113.0.5672.126]
Additional context
FYI @EthanRutherford
This issue has been addressed in the latest release, please let us know if you encounter further problems!
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.
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.