Skip to content

🎉 add region tooltip for income groups#6092

Merged
sophiamersmann merged 1 commit intomasterfrom
region-dods-income-groups
Feb 24, 2026
Merged

🎉 add region tooltip for income groups#6092
sophiamersmann merged 1 commit intomasterfrom
region-dods-income-groups

Conversation

@sophiamersmann
Copy link
Member

@sophiamersmann sophiamersmann commented Feb 13, 2026

Adds region dod support for income groups that are a bit different than normal regions because they don't come with a suffix. The icon just shows up after the name, e.g. 'High-income countries ℹ️'

@github-actions github-actions bot added the staging-viz Let SVG tester fail silently in CI label Feb 13, 2026
Copy link
Member Author

sophiamersmann commented Feb 13, 2026

@owidbot
Copy link
Contributor

owidbot commented Feb 13, 2026

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-region-dods-income-groups

Archive:
SVG tester:

Number of differences (graphers): 1871 (2b3bb2) ❌ Report
Number of differences (grapher views): 657 (83d7c6) ❌ Report
Number of differences (mdims): 168 (9c0c2d) ❌ Report
Number of differences (explorers): 940 (db8449) ❌ Report

Edited: 2026-02-24 12:13:40 UTC
Execution time: 1.33 seconds

@sophiamersmann sophiamersmann changed the title 🔄 Rename OwidIncomeGroupName to OwidIncomeGroupCode and add income group tooltips 🎉 add region tooltip for income groups Feb 13, 2026
@sophiamersmann sophiamersmann force-pushed the region-dods-income-groups branch from 5b0ce2d to d065586 Compare February 16, 2026 13:01
@sophiamersmann sophiamersmann force-pushed the region-dods-income-groups branch from d065586 to 2c5f282 Compare February 16, 2026 13:21
@sophiamersmann sophiamersmann changed the base branch from region-dods-tooltip to graphite-base/6092 February 18, 2026 17:01
@sophiamersmann sophiamersmann force-pushed the region-dods-income-groups branch from 2c5f282 to c07855a Compare February 18, 2026 17:01
@sophiamersmann sophiamersmann marked this pull request as ready for review February 18, 2026 17:18
"Latin America-Caribbean (Pew)": OwidDistinctColors.Maroon,
"Middle East-North Africa (Pew)": OwidDistinctColors.Camel,

// Income groups
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding income groups here also means that selecting the Continents palette will automatically pick the right colours for income groups. Bit of a misnomer, of course

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't need the colours in this PR, but I will need them in the next when I render region maps in the tooltip

| "Upper-middle-income countries"
| "High-income countries"

export type OwidIncomeGroupCode =
Copy link
Member Author

Choose a reason for hiding this comment

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

Correcting a bit of a misnomer. 'Code' should refer to 'OWID_LIC' and 'name' to 'Low-income countries'

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c07855aff3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +295 to +297
// If there's an income group icon, it must be placed on the same line as the name
if (this.incomeGroupFragments) return "incomeGroupIcon"

Choose a reason for hiding this comment

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

P2 Badge Reserve width before forcing income-group icon onto name line

When showRegionTooltip is enabled and the label is an income-group name, roleOnNameLine always returns "incomeGroupIcon" without any fit check. Unlike the provider-suffix path (which uses canAppendTextToLastLine and reserved width), this can make SeriesLabelState.width exceed the configured maxWidth in narrow legends/facets, so labels overflow their allocated space and can collide with nearby chart content. This regression is specific to income-group labels near the width limit.

Useful? React with 👍 / 👎.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should be fine in practice because we base calculations typically on the actual width, so it's ok if it's a bit larger

Copy link
Member Author

sophiamersmann commented Feb 24, 2026

Merge activity

  • Feb 24, 1:52 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 24, 1:59 PM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 24, 1:59 PM UTC: @sophiamersmann merged this pull request with Graphite.

@sophiamersmann sophiamersmann changed the base branch from region-dods-icon to graphite-base/6092 February 24, 2026 13:56
@sophiamersmann sophiamersmann changed the base branch from graphite-base/6092 to master February 24, 2026 13:57
@sophiamersmann sophiamersmann force-pushed the region-dods-income-groups branch from 98b21fa to 54cd547 Compare February 24, 2026 13:58
@sophiamersmann sophiamersmann merged commit 8b8e56b into master Feb 24, 2026
18 of 21 checks passed
@sophiamersmann sophiamersmann deleted the region-dods-income-groups branch February 24, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-code-assisted staging-viz Let SVG tester fail silently in CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants