diff --git a/README.md b/README.md index f06d2aa..b475b08 100644 --- a/README.md +++ b/README.md @@ -65,3 +65,16 @@ A typical Framework project looks like this: ## GPT-4 reference https://chat.openai.com/share/0284945f-996d-4e62-85c5-bdc0f4e68e18 + +## Making GIFs for demos + +1. Use Quicktime Player to record a screen recording. +2. Use `ffmpeg` to trim the recording: +```sh +ffmpeg -ss 00:00:03 -to 00:00:08 -i recording.mov -c copy trimmed_recording.mov +``` +3. Use `ffmpeg` to convert the trimmed recording to a GIF: +```sh +ffmpeg -i trimmed_recording.mov -vf "fps=20,scale=1080:-1:flags=lanczos,palettegen=stats_mode=diff" -y palette.png +ffmpeg -i trimmed_recording.mov -i palette.png -filter_complex "fps=20,scale=1080:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle" -y high_quality.gif +``` \ No newline at end of file diff --git a/docs/data/income-histogram-historical-new-york-area-by-race.parquet b/docs/data/income-histogram-historical-new-york-area-by-race.parquet index 3762d3b..f1566e3 100644 Binary files a/docs/data/income-histogram-historical-new-york-area-by-race.parquet and b/docs/data/income-histogram-historical-new-york-area-by-race.parquet differ diff --git a/docs/new-york-area.md b/docs/new-york-area.md index 79e0bd9..3133747 100644 --- a/docs/new-york-area.md +++ b/docs/new-york-area.md @@ -86,8 +86,8 @@ const income = await db.query(` @@ -119,7 +119,7 @@ function incomeChart(income, width) { } ) ), - // Plot.ruleX([medianIncome], {stroke: "red", strokeWidth: 2}) + // Plot.ruleX([medianIncome[0].median_income], {stroke: "red", strokeWidth: 2}) ], }); } diff --git a/docs/new-york-area/income-by-race.md b/docs/new-york-area/income-by-race.md index ecc9c24..a7d02f7 100644 --- a/docs/new-york-area/income-by-race.md +++ b/docs/new-york-area/income-by-race.md @@ -67,13 +67,6 @@ const selectedStateCode = selectedPUMADetails.stateCode; ```js const mostRecentYear = uniqueYears[uniqueYears.length - 1]; -const orderSectors = await db.query(` - SELECT sector, SUM(income * count) / SUM(count) AS mean_income - FROM data - WHERE year = ${mostRecentYear} - GROUP BY sector - ORDER BY mean_income DESC -`).then(data => data.map(d => d.sector)); ``` ```js diff --git a/observablehq.config.ts b/observablehq.config.ts index ff5c0e0..e2ec1aa 100644 --- a/observablehq.config.ts +++ b/observablehq.config.ts @@ -11,7 +11,8 @@ export default { name: "Variables in the Survey", pages: [ {name: "Income over the years", path: "/income"}, - {name: "New York area income over the years", path: "/new-york-area"} + {name: "New York area income over the years", path: "/new-york-area"}, + {name: "New York area income across time, space, and race", path: "/new-york-area/income-by-race"} ] } ],