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

✨ deduplicate sources tab by label / TAS-793 #4421

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented Jan 9, 2025

This PR deduplicates the sources based on their label.

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 source tab for every imported indicator – even when their identical.

For scatter plots like this one that use the same indicator twice with different target years, the sources also appear twice.

I can't think of a situation where the tab label would be exactly the same, but we'd still want to show both tabs. So I decided to deduplicate by label. It would be safer to deduplicate on all of the content, but that seems wasteful.

SVG testet differences come from a previous PR.

Before After
Screenshot 2025-01-09 at 15 32 59 Screenshot 2025-01-09 at 15 33 56

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 2 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-sources-tabs

SVG tester:

Number of differences (default views): 4 (2abfb5) ❌
Number of differences (all views): 0 ✅

Edited: 2025-01-09 17:18:28 UTC
Execution time: 1.22 seconds

@sophiamersmann sophiamersmann force-pushed the deduplicate-line-labels branch from 1763dbe to 16aefe0 Compare January 9, 2025 12:52
@sophiamersmann sophiamersmann force-pushed the deduplicate-sources-tabs branch from f14f80e to 3ef02e0 Compare January 9, 2025 12:52
@sophiamersmann sophiamersmann force-pushed the deduplicate-line-labels branch from 16aefe0 to 9cce322 Compare January 9, 2025 15:09
@sophiamersmann sophiamersmann force-pushed the deduplicate-sources-tabs branch from 3ef02e0 to 56f5a7e Compare January 9, 2025 15:09
@sophiamersmann sophiamersmann added the staging-viz Let SVG tester fail silently in CI label Jan 9, 2025
Base automatically changed from deduplicate-line-labels to master January 9, 2025 17:00
@sophiamersmann sophiamersmann force-pushed the deduplicate-sources-tabs branch from 56f5a7e to 1058a78 Compare January 9, 2025 17:03
@sophiamersmann sophiamersmann marked this pull request as ready for review January 9, 2025 17:04
@sophiamersmann sophiamersmann changed the title ✨ deduplicate sources tab by label ✨ deduplicate sources tab by label / TAS-793 Jan 10, 2025
Copy link

Deduplicate sources

Copy link
Contributor

@danyx23 danyx23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see this fixed! I agree about the question of what to deduplicate on - if this causes any issues in the future we can tackle those when we have a concrete case where it causes problems.

@sophiamersmann sophiamersmann merged commit ebce782 into master Jan 14, 2025
26 checks passed
@sophiamersmann sophiamersmann deleted the deduplicate-sources-tabs branch January 14, 2025 11:39
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.

3 participants