Skip to content

Commit

Permalink
Merge pull request #15 from concord-consortium/188233118-country-boun…
Browse files Browse the repository at this point in the history
…daries

Add Boundary column
  • Loading branch information
pjanik authored Sep 10, 2024
2 parents 24388a2 + 0ca388d commit 828f8f4
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 195 deletions.
9 changes: 9 additions & 0 deletions src/data/codap-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ export const kParentCollectionAttributes = [
name: "Country",
type: "categorical"
},
{
name: "Code",
type: "categorical",
hidden: true
},
{
name: "Boundary",
formula: "lookupBoundary(country_boundaries, Code)"
},
{
name: "Region",
type: "categorical"
Expand Down
6 changes: 6 additions & 0 deletions src/data/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,42 @@ describe("request", () => {
{
Year: "2022",
Country: "Afghanistan",
Code: "AF",
Region: "Eastern Mediterranean Region",
"Obesity, Children (5-9 yr)": 9.56
},
{
Year: "2021",
Country: "Afghanistan",
Code: "AF",
Region: "Eastern Mediterranean Region",
"Obesity, Children (5-9 yr)": 8.9
},
{
Year: "2020",
Country: "Afghanistan",
Code: "AF",
Region: "Eastern Mediterranean Region",
"Obesity, Children (5-9 yr)": 8.27
},
{
Year: "2022",
Country: "Albania",
Code: "AL",
Region: "European Region",
"Obesity, Children (5-9 yr)": 11.23
},
{
Year: "2021",
Country: "Albania",
Code: "AL",
Region: "European Region",
"Obesity, Children (5-9 yr)": 10.95
},
{
Year: "2020",
Country: "Albania",
Code: "AL",
Region: "European Region",
"Obesity, Children (5-9 yr)": 10.68
}
Expand Down
1 change: 1 addition & 0 deletions src/data/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const requestData = async (options: IRequestDataOptions): Promise<ICaseVa

countryYearMap[`${countryId}-${yearId}`] = {
Country: country.name,
Code: country.code,
Region: region.name,
Year: year.name,
};
Expand Down
Loading

0 comments on commit 828f8f4

Please sign in to comment.