Skip to content

Commit 3d392cd

Browse files
committed
Add 2024 data to comparisons page
1 parent c4fd382 commit 3d392cd

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

pages/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import {
2121
} from "lib/selects"
2222
import { scoreFnWithPopulation } from "lib/utils"
2323

24+
const MAX_YEAR = 2024
25+
2426
/**
2527
* Returns a pair (year ranges, first year not in a range)
2628
*/
@@ -67,7 +69,7 @@ function makeYearBuckets(
6769
})
6870
}
6971
}
70-
for (let year = firstNonRangeYear; year <= 2023; year++) {
72+
for (let year = firstNonRangeYear; year <= MAX_YEAR; year++) {
7173
yearBuckets.push({
7274
year: year,
7375
binned_year: year,
@@ -81,7 +83,7 @@ function getYearTickValues(grouping) {
8183
if (grouping === "none") {
8284
return null
8385
} else if (grouping === "five_years") {
84-
return [1982, 1987, 1992, 1997, 2002, 2007, 2012, 2017, 2020]
86+
return [1982, 1987, 1992, 1997, 2002, 2007, 2012, 2017, 2020, 2024]
8587
}
8688
}
8789

@@ -162,7 +164,7 @@ function spec(
162164
key: "year",
163165
fields: ["binned_year"],
164166
},
165-
default: 2023,
167+
default: MAX_YEAR,
166168
},
167169
]
168170
)
@@ -342,7 +344,7 @@ function getData(path: string): object {
342344
function combineDatas(datas) {
343345
const data = datas
344346
.flatMap((d) => d.data ?? [])
345-
.filter((d) => d.year != "2024")
347+
.filter((d) => parseInt(d.year) <= MAX_YEAR)
346348

347349
return data
348350
}

0 commit comments

Comments
 (0)