🎉 add region tooltip for income groups#6092
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Quick links (staging server):
Login:
Archive:SVG tester:Number of differences (graphers): 1871 (2b3bb2) ❌ Report Edited: 2026-02-24 12:13:40 UTC |
6472bc6 to
d0a8901
Compare
5b0ce2d to
d065586
Compare
d0a8901 to
c329e94
Compare
d065586 to
2c5f282
Compare
2c5f282 to
c07855a
Compare
c329e94 to
857f60a
Compare
| "Latin America-Caribbean (Pew)": OwidDistinctColors.Maroon, | ||
| "Middle East-North Africa (Pew)": OwidDistinctColors.Camel, | ||
|
|
||
| // Income groups |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 = |
There was a problem hiding this comment.
Correcting a bit of a misnomer. 'Code' should refer to 'OWID_LIC' and 'name' to 'Low-income countries'
There was a problem hiding this comment.
💡 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".
| // If there's an income group icon, it must be placed on the same line as the name | ||
| if (this.incomeGroupFragments) return "incomeGroupIcon" | ||
|
|
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
Should be fine in practice because we base calculations typically on the actual width, so it's ok if it's a bit larger
c07855a to
da12e6f
Compare
857f60a to
4c8bbe7
Compare
4c8bbe7 to
e329d31
Compare
da12e6f to
31cf6d6
Compare
31cf6d6 to
7ad73da
Compare
e329d31 to
4a07694
Compare
7ad73da to
dd2105c
Compare
4a07694 to
63af5d2
Compare
dd2105c to
98b21fa
Compare
63af5d2 to
b842fdc
Compare
Merge activity
|
98b21fa to
54cd547
Compare

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 ℹ️'