diff --git a/docs/data/income-histogram-historical-new-york-area.parquet b/docs/data/income-histogram-historical-new-york-area.parquet index 01efeb3..6958847 100644 Binary files a/docs/data/income-histogram-historical-new-york-area.parquet and b/docs/data/income-histogram-historical-new-york-area.parquet differ diff --git a/docs/new-york-area.md b/docs/new-york-area.md index 0ce848a..79e0bd9 100644 --- a/docs/new-york-area.md +++ b/docs/new-york-area.md @@ -8,7 +8,7 @@ const db = DuckDBClient.of({data: FileAttachment("data/income-histogram-historic ``` ```js -const uniqueYears = await db.query("SELECT DISTINCT year FROM data WHERE year BETWEEN 2010 AND 2022 ORDER BY year").then(data => data.map(d => d.year)); +const uniqueYears = await db.query("SELECT DISTINCT year FROM data WHERE year BETWEEN 2005 AND 2022 ORDER BY year").then(data => data.map(d => d.year)); const yearRange = [uniqueYears[0], uniqueYears[uniqueYears.length - 1]]; const yearInput = Inputs.range(yearRange, { step: 1, @@ -33,9 +33,8 @@ const stateCodeToName = { // Fetch PUMA details, including state names based on the hardcoded map const pumaDetails = await db.query(` - SELECT DISTINCT puma, FIRST(puma_name) AS puma_name, state_code + SELECT DISTINCT puma, puma_name, state_code FROM data - GROUP BY puma, state_code `).then(data => data.map(d => ({ puma: d.puma, stateCode: d.state_code, @@ -54,7 +53,7 @@ pumaDetails.sort((a, b) => { ```js const PUMAInput = Inputs.select(pumaDetails, { - label: "Select PUMA", + label: "Select area", value: d => d.puma, format: d => d.label }); @@ -128,8 +127,8 @@ function incomeChart(income, width) {
Code for data transform
Code for data transform