Skip to content

Commit

Permalink
remove the grouping stuff I was trying to do, that's more complicated
Browse files Browse the repository at this point in the history
  • Loading branch information
sid-kap committed May 3, 2024
1 parent 1848a8f commit f824ee2
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ function getYearRanges(grouping: string): [Array<[number, number]>, number] {
[2005, 2009],
[2010, 2014],
[2015, 2019],
[2020, 2023],
],
2024,
2020,
]
} else {
throw new Error(`Grouping type ${grouping} unknown`)
Expand Down Expand Up @@ -68,7 +67,7 @@ function makeYearBuckets(
})
}
}
for (let year = firstNonRangeYear; year <= 2024; year++) {
for (let year = firstNonRangeYear; year <= 2023; year++) {
yearBuckets.push({
year: year,
binned_year: year,
Expand All @@ -82,7 +81,7 @@ function getYearTickValues(grouping) {
if (grouping === "none") {
return null
} else if (grouping === "five_years") {
return [1982, 1987, 1992, 1997, 2002, 2007, 2012, 2017, 2021.5]
return [1982, 1987, 1992, 1997, 2002, 2007, 2012, 2017]
}
}

Expand Down Expand Up @@ -144,7 +143,6 @@ function spec(
}
}
}
console.log(makeYearBuckets(grouping))
transforms.push(
...[
{
Expand All @@ -171,14 +169,6 @@ function spec(
},
default: 2023,
},
{
aggregate: [
{
op: "mean",
field: [""],
},
],
},
]
)

Expand Down Expand Up @@ -247,7 +237,7 @@ function spec(
encoding: {
x: { aggregate: "max", field: "binned_year" },
y: { aggregate: { argmax: "binned_year" }, field: yField },
text: { aggregate: { argmax: "binned_year" }, field: "year" }, // field: "name"
text: { aggregate: { argmax: "binned_year" }, field: "name" },
},
},
],
Expand Down

0 comments on commit f824ee2

Please sign in to comment.