Skip to content

Commit

Permalink
Merge pull request #4179 from owid/switch-to-new-owid-regions-and-twe…
Browse files Browse the repository at this point in the history
…ak-colors

✨ switch to the new owid regions data and tweak colors for regions
  • Loading branch information
danyx23 authored Nov 21, 2024
2 parents 95a5743 + 8c1a77d commit a2a2d44
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/@ourworldindata/grapher/src/color/CustomSchemes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,14 @@ CustomColorSchemes.push({

export const ContinentColors = {
Africa: OwidDistinctColors.Mauve,
Antarctica: OwidDistinctColors.Turquoise,
Antarctica: OwidDistinctColors.DarkCopper,
Asia: OwidDistinctColors.Teal,
Europe: OwidDistinctColors.Denim,
NorthAmerica: OwidDistinctColors.Peach,
["North America"]: OwidDistinctColors.Peach,
SouthAmerica: OwidDistinctColors.Maroon,
["South America"]: OwidDistinctColors.Maroon,
Oceania: OwidDistinctColors.DarkCopper,
Oceania: OwidDistinctColors.Turquoise,
World: OwidDistinctColors.DarkOliveGreen,
SubSaharanAfrica: OwidDistinctColors.DarkMauve,
MiddleEastNorthAfrica: OwidDistinctColors.Purple,
Expand All @@ -340,7 +340,6 @@ const ContinentColorsNames = lazy(() => invert(ContinentColors))

const ContinentColorPalette = [
ContinentColors.Africa,
ContinentColors.Antarctica,
ContinentColors.Asia,
ContinentColors.Europe,
ContinentColors.NorthAmerica,
Expand All @@ -357,6 +356,7 @@ const ContinentColorPalette = [
ContinentColors.EasternEurope,
ContinentColors.WesternEurope,
ContinentColors.AustralasiaAndOceania,
ContinentColors.Antarctica,
]

export const ContinentColorsColorScheme = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const ThereWasAProblemLoadingThisChart = `There was a problem loading thi

export const WorldEntityName = "World"

export const CONTINENTS_INDICATOR_ID = 123 // "Countries Continent"
export const CONTINENTS_INDICATOR_ID = 900801 // "Countries Continent"
export const POPULATION_INDICATOR_ID_USED_IN_ADMIN = 953899 // "Population (various sources, 2024-07-15)"
export const POPULATION_INDICATOR_ID_USED_IN_ENTITY_SELECTOR = 953903 // "Population (historical) (various sources, 2024-07-15)"
export const GDP_PER_CAPITA_INDICATOR_ID_USED_IN_ENTITY_SELECTOR = 905490 // "World Development Indicators - World Bank (2024-05-20)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,8 @@ const columnDefFromOwidVariable = (
shortName,
} = variable

// Without this the much used var 123 appears as "Countries Continent". We could rename in Grapher but not sure the effects of that.
const isContinent = isContinentsVariableId(variable.id)
const name = isContinent ? "Continent" : variable.name
const name = variable.name

// The column's type
const type = isContinent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ describe("colors & legend", () => {
[2, "Canada", "", 2000, 1, 1, "North America", null],
[3, "China", "", 2000, 1, null, "Asia", null],
[4, "Australia", "", 2000, 1, 1, "Oceania", null],
[5, "Antarctica", "", 2000, null, null, "Antarctica", null],
[6, "Chile", "", 2000, 1, 1, "South America", null],
[7, "Nigeria", "", 2000, 1, 1, "Africa", null],
],
Expand Down Expand Up @@ -507,7 +506,6 @@ describe("colors & legend", () => {
Canada: "North America",
China: "Asia",
Australia: "Oceania",
Antarctica: "Antarctica",
Chile: "South America",
Nigeria: "Africa",
}
Expand All @@ -531,7 +529,6 @@ describe("colors & legend", () => {
it("legend contains every continent for which there is data (before timeline filter)", () => {
expect(chart.legendItems.map((item) => item.label).sort()).toEqual([
"Africa",
"Antarctica",
"Europe",
"North America",
"Oceania",
Expand Down

0 comments on commit a2a2d44

Please sign in to comment.