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

✨ (map) left-align multi-line categorical legends #4324

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented Dec 17, 2024

Resolves #3988 by left-aligning categorical map legends when they have more than one line.

Introduces a bit of a regression, where the left/right padding around legend is removed (see second screenshot below). The padding has to be zero when the legend is left-aligned, but I can't add a condition to the code to that effect since that would introduce a cyclic dependency (to know whether to left-align the legend, I need to know the number of lines, and to know the number of lines, I need to know the maxLegendWidth).

Before After
Screenshot 2024-12-17 at 12 55 11 Screenshot 2024-12-17 at 12 55 02
Screenshot 2024-12-17 at 12 57 13

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@owidbot
Copy link
Contributor

owidbot commented Dec 17, 2024

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-map-left-align-legend

SVG tester:

Number of differences (default views): 88 (d0a844) ❌
Number of differences (all views): 0 ✅

Edited: 2024-12-17 11:31:35 UTC
Execution time: 1.27 seconds

@sophiamersmann sophiamersmann marked this pull request as ready for review December 17, 2024 12:03
@sophiamersmann sophiamersmann merged commit f4a8e4c into master Dec 17, 2024
23 of 25 checks passed
@sophiamersmann sophiamersmann deleted the map-left-align-legend branch December 17, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Left-align categorical map legends
2 participants