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

✨ (line) deduplicate line labels #4420

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented Jan 9, 2025

In rare cases, authors hack line charts to show breaks between line segments. They do so by using the same indicator multiple times. One side effect is that Grapher then shows a line legend label for each of these lines.

This PR makes this a bit better by de-duplicating line legend labels. I can't think of a use case where we'd want to show identical line labels.

Before After
Screenshot 2025-01-09 at 13 04 44 Screenshot 2025-01-09 at 13 04 59

Link: https://ourworldindata.org/explorers/poverty-explorer?facet=none&country=BOL~DEU~ALB&Indicator=Share+in+poverty&Poverty+line=%242.15+per+day%3A+International+Poverty+Line&Household+survey+data+type=Show+data+from+both+income+and+consumption+surveys&Show+breaks+between+less+comparable+surveys=true


This is part 1 of 2 in a stack made with GitButler:

@owidbot
Copy link
Contributor

owidbot commented Jan 9, 2025

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-deduplicate-line-labels

SVG tester:

Number of differences (default views): 4 (827c54) ❌
Number of differences (all views): 0 ✅

Edited: 2025-01-09 15:33:33 UTC
Execution time: 1.28 seconds

@sophiamersmann sophiamersmann force-pushed the deduplicate-line-labels branch from 16aefe0 to 9cce322 Compare January 9, 2025 15:09
@sophiamersmann sophiamersmann added the staging-viz Let SVG tester fail silently in CI label Jan 9, 2025
@sophiamersmann sophiamersmann marked this pull request as ready for review January 9, 2025 16:59
@sophiamersmann sophiamersmann merged commit 83b0f95 into master Jan 9, 2025
20 of 22 checks passed
@sophiamersmann sophiamersmann deleted the deduplicate-line-labels branch January 9, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging-viz Let SVG tester fail silently in CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants