diff --git a/examples/fiverthirtyeight-example/.eslintrc.json b/examples/fivethirtyeight/.eslintrc.json similarity index 100% rename from examples/fiverthirtyeight-example/.eslintrc.json rename to examples/fivethirtyeight/.eslintrc.json diff --git a/examples/fiverthirtyeight-example/.gitignore b/examples/fivethirtyeight/.gitignore similarity index 100% rename from examples/fiverthirtyeight-example/.gitignore rename to examples/fivethirtyeight/.gitignore diff --git a/examples/fiverthirtyeight-example/README.md b/examples/fivethirtyeight/README.md similarity index 100% rename from examples/fiverthirtyeight-example/README.md rename to examples/fivethirtyeight/README.md diff --git a/examples/fiverthirtyeight-example/components/Breadcrumbs.tsx b/examples/fivethirtyeight/components/Breadcrumbs.tsx similarity index 100% rename from examples/fiverthirtyeight-example/components/Breadcrumbs.tsx rename to examples/fivethirtyeight/components/Breadcrumbs.tsx diff --git a/examples/fiverthirtyeight-example/datasets.json b/examples/fivethirtyeight/datasets.json similarity index 91% rename from examples/fiverthirtyeight-example/datasets.json rename to examples/fivethirtyeight/datasets.json index 22480434..815b2581 100644 --- a/examples/fiverthirtyeight-example/datasets.json +++ b/examples/fivethirtyeight/datasets.json @@ -1,46 +1,11 @@ [ - { - "url": "https://github.com/fivethirtyeight/data/tree/master/nba-forecasts", - "name": "nba-forecasts", - "displayName": "nba-forecasts", - "articles": [ - { - "date": "2023-05-08T22:33:43.000Z", - "title": "2022-23 NBA Predictions", - "url": "https://projects.fivethirtyeight.com/2023-nba-predictions/" - } - ], - "files": [ - "https://projects.fivethirtyeight.com/nba-model/nba_elo.csv", - "https://projects.fivethirtyeight.com/nba-model/nba_elo_latest.csv" - ] - }, - { - "url": "https://github.com/fivethirtyeight/data/tree/master/soccer-spi", - "name": "soccer-spi", - "displayName": "soccer-spi", - "articles": [ - { - "date": "2023-05-08T22:17:18.000Z", - "title": "Club Soccer Predictions", - "url": "https://projects.fivethirtyeight.com/soccer-predictions/" - } - ], - "files": [ - "https://projects.fivethirtyeight.com/soccer-api/club/spi_matches.csv", - "https://projects.fivethirtyeight.com/soccer-api/club/spi_matches_latest.csv", - "https://projects.fivethirtyeight.com/soccer-api/club/spi_global_rankings.csv", - "https://projects.fivethirtyeight.com/soccer-api/international/spi_matches_intl.csv", - "https://projects.fivethirtyeight.com/soccer-api/international/spi_global_rankings_intl.csv" - ] - }, { "url": "https://github.com/fivethirtyeight/data/tree/master/polls", "name": "polls", "displayName": "polls", "articles": [ { - "date": "2023-05-08T20:36:59.000Z", + "date": "2023-05-11T14:35:40.000Z", "title": "Latest Polls", "url": "https://projects.fivethirtyeight.com/polls/" } @@ -63,13 +28,45 @@ "https://projects.fivethirtyeight.com/2020-general-data/presidential_poll_averages_2020.csv" ] }, + { + "url": "https://github.com/fivethirtyeight/data/tree/master/congress-generic-ballot", + "name": "congress-generic-ballot", + "displayName": "congress-generic-ballot", + "articles": [ + { + "date": "2023-05-11T14:35:40.000Z", + "title": "Do Voters Want Democrats Or Republicans In Congress?", + "url": "https://projects.fivethirtyeight.com/congress-generic-ballot-polls/" + } + ], + "files": [ + "https://projects.fivethirtyeight.com/generic-ballot-data/generic_polllist.csv", + "https://projects.fivethirtyeight.com/polls/data/generic_ballot_averages.csv" + ] + }, + { + "url": "https://github.com/fivethirtyeight/data/tree/master/nba-forecasts", + "name": "nba-forecasts", + "displayName": "nba-forecasts", + "articles": [ + { + "date": "2023-05-11T11:15:46.000Z", + "title": "2022-23 NBA Predictions", + "url": "https://projects.fivethirtyeight.com/2023-nba-predictions/" + } + ], + "files": [ + "https://projects.fivethirtyeight.com/nba-model/nba_elo.csv", + "https://projects.fivethirtyeight.com/nba-model/nba_elo_latest.csv" + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/nba-raptor", "name": "nba-raptor", "displayName": "nba-raptor", "articles": [ { - "date": "2023-05-08T11:15:48.000Z", + "date": "2023-05-11T11:13:20.000Z", "title": "The Best NBA Players, According To RAPTOR", "rowspan": 3, "url": "https://projects.fivethirtyeight.com/nba-player-ratings/" @@ -92,13 +89,32 @@ "https://projects.fivethirtyeight.com/nba-model/2023/latest_RAPTOR_by_player.csv" ] }, + { + "url": "https://github.com/fivethirtyeight/data/tree/master/soccer-spi", + "name": "soccer-spi", + "displayName": "soccer-spi", + "articles": [ + { + "date": "2023-05-11T05:25:51.000Z", + "title": "Club Soccer Predictions", + "url": "https://projects.fivethirtyeight.com/soccer-predictions/" + } + ], + "files": [ + "https://projects.fivethirtyeight.com/soccer-api/club/spi_matches.csv", + "https://projects.fivethirtyeight.com/soccer-api/club/spi_matches_latest.csv", + "https://projects.fivethirtyeight.com/soccer-api/club/spi_global_rankings.csv", + "https://projects.fivethirtyeight.com/soccer-api/international/spi_matches_intl.csv", + "https://projects.fivethirtyeight.com/soccer-api/international/spi_global_rankings_intl.csv" + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/nhl-forecasts", "name": "nhl-forecasts", "displayName": "nhl-forecasts", "articles": [ { - "date": "2023-05-08T04:18:20.000Z", + "date": "2023-05-11T04:53:22.000Z", "title": "2022-23 NHL Predictions", "url": "https://projects.fivethirtyeight.com/2023-nhl-predictions/" } @@ -114,7 +130,7 @@ "displayName": "mlb-elo", "articles": [ { - "date": "2023-05-08T02:25:55.000Z", + "date": "2023-05-11T02:35:49.000Z", "title": "2023 MLB Predictions", "url": "https://projects.fivethirtyeight.com/2023-mlb-predictions/" } @@ -124,22 +140,6 @@ "https://projects.fivethirtyeight.com/mlb-api/mlb_elo_latest.csv" ] }, - { - "url": "https://github.com/fivethirtyeight/data/tree/master/congress-generic-ballot", - "name": "congress-generic-ballot", - "displayName": "congress-generic-ballot", - "articles": [ - { - "date": "2023-05-02T13:48:41.000Z", - "title": "Do Voters Want Democrats Or Republicans In Congress?", - "url": "https://projects.fivethirtyeight.com/congress-generic-ballot-polls/" - } - ], - "files": [ - "https://projects.fivethirtyeight.com/generic-ballot-data/generic_polllist.csv", - "https://projects.fivethirtyeight.com/polls/data/generic_ballot_averages.csv" - ] - }, { "url": "https://github.com/fivethirtyeight/data/tree/master/congress-demographics", "name": "congress-demographics", @@ -211,6 +211,18 @@ "https://projects.fivethirtyeight.com/nfl-api/nfl_elo_latest.csv" ] }, + { + "url": "https://github.com/fivethirtyeight/checking-our-work-data", + "name": "checking-our-work-data", + "displayName": "checking-our-work-data", + "articles": [ + { + "date": "2023-02-02T16:30:00.000Z", + "title": "How Good Are FiveThirtyEight Forecasts?", + "url": "https://projects.fivethirtyeight.com/checking-our-work/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/world-cup-2022", "name": "world-cup-2022", @@ -227,6 +239,18 @@ "https://projects.fivethirtyeight.com/soccer-api/international/2022/wc_forecasts.csv" ] }, + { + "url": "https://github.com/fivethirtyeight/covid-19-polls", + "name": "covid-19-polls", + "displayName": "covid-19-polls", + "articles": [ + { + "date": "2022-11-29T20:20:08.000Z", + "title": "How Americans View Biden’s Response To The Coronavirus Crisis", + "url": "https://projects.fivethirtyeight.com/coronavirus-polls/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/election-deniers", "name": "election-deniers", @@ -347,6 +371,18 @@ } ] }, + { + "url": "https://github.com/fivethirtyeight/nfl-elo-game", + "name": "nfl-elo-game", + "displayName": "nfl-elo-game", + "articles": [ + { + "date": "2022-02-14T03:03:26.000Z", + "title": "Can You Beat FiveThirtyEight’s NFL Forecasts?", + "url": "https://projects.fivethirtyeight.com/2021-nfl-forecasting-game/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/redlining", "name": "redlining", @@ -371,6 +407,42 @@ } ] }, + { + "url": "https://github.com/fivethirtyeight/negro-leagues-player-ratings", + "name": "negro-leagues-player-ratings", + "displayName": "negro-leagues-player-ratings", + "articles": [ + { + "date": "2021-02-25T11:00:00.000Z", + "title": "The Negro League Stars That MLB Kept Out — And Is Finally Recognizing", + "url": "https://projects.fivethirtyeight.com/negro-leagues-mlb/" + } + ] + }, + { + "url": "https://github.com/fivethirtyeight/police-settlements", + "name": "police-settlements", + "displayName": "police-settlements", + "articles": [ + { + "date": "2021-02-22T11:00:49.000Z", + "title": "Cities Spend Millions On Police Misconduct Every Year. Here’s Why It’s So Difficult to Hold Departments Accountable.", + "url": "https://fivethirtyeight.com/features/police-misconduct-costs-cities-millions-every-year-but-thats-where-the-accountability-ends/" + } + ] + }, + { + "url": "https://github.com/fivethirtyeight/superbowl-ads", + "name": "superbowl-ads", + "displayName": "superbowl-ads", + "articles": [ + { + "date": "2021-02-04T16:11:00.000Z", + "title": "According To Super Bowl Ads, Americans Love America, Animals And Sex", + "url": "https://projects.fivethirtyeight.com/super-bowl-ads/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/trump-approval-ratings", "name": "trump-approval-ratings", @@ -403,6 +475,18 @@ "https://projects.fivethirtyeight.com/congress-tracker-data/csv/vote_predictions.csv" ] }, + { + "url": "https://github.com/fivethirtyeight/election-results", + "name": "election-results", + "displayName": "election-results", + "articles": [ + { + "date": "2020-11-03T05:33:43.000Z", + "title": "2020 Election Forecast", + "url": "https://projects.fivethirtyeight.com/2020-election-forecast/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/election-forecasts-2020", "name": "election-forecasts-2020", @@ -473,6 +557,18 @@ } ] }, + { + "url": "https://github.com/fivethirtyeight/WNBA-stats", + "name": "WNBA-stats", + "displayName": "WNBA-stats", + "articles": [ + { + "date": "2020-05-27T19:06:43.000Z", + "title": "It’s Time To Give Basketball’s Other GOAT Her Due", + "url": "https://fivethirtyeight.com/features/its-time-to-give-basketballs-other-goat-her-due/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/covid-geography", "name": "covid-geography", @@ -512,6 +608,18 @@ "https://projects.fivethirtyeight.com/endorsements-2020-data/endorsements-2020.csv" ] }, + { + "url": "https://github.com/fivethirtyeight/nba-player-advanced-metrics", + "name": "nba-player-advanced-metrics", + "displayName": "nba-player-advanced-metrics", + "articles": [ + { + "date": "2020-03-09T15:27:37.000Z", + "title": "Luka Dončić And The Mavs Are Pushing The Limits Of Offensive Efficiency", + "url": "https://fivethirtyeight.com/features/luka-doncic-and-the-mavs-are-pushing-the-limits-of-offensive-efficiency/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/impeachment-polls", "name": "impeachment-polls", @@ -603,6 +711,18 @@ } ] }, + { + "url": "https://github.com/fivethirtyeight/candidate-emails", + "name": "candidate-emails", + "displayName": "candidate-emails", + "articles": [ + { + "date": "2019-07-11T15:33:15.000Z", + "title": "What Our Inbox Tells Us About How Democrats Are Tackling Trump", + "url": "https://fivethirtyeight.com/features/which-democrats-are-campaigning-on-trump/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/nba-draymond", "name": "nba-draymond", @@ -643,6 +763,18 @@ } ] }, + { + "url": "https://github.com/fivethirtyeight/twitter-overlap", + "name": "twitter-overlap", + "displayName": "twitter-overlap", + "articles": [ + { + "date": "2019-06-12T15:24:07.000Z", + "title": "Which 2020 Candidates Have The Most In Common … On Twitter?", + "url": "https://fivethirtyeight.com/features/which-2020-candidates-have-the-most-in-common-on-twitter/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/trump-lawsuits", "name": "trump-lawsuits", @@ -825,6 +957,18 @@ "https://projects.fivethirtyeight.com/congress-model-2018/governor_state_forecast.csv" ] }, + { + "url": "https://github.com/fivethirtyeight/actblue-analysis", + "name": "actblue-analysis", + "displayName": "actblue-analysis", + "articles": [ + { + "date": "2018-10-25T17:31:42.000Z", + "title": "How ActBlue Is Trying To Turn Small Donations Into A Blue Wave", + "url": "https://fivethirtyeight.com/features/how-actblue-is-trying-to-turn-small-donations-into-a-blue-wave" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/primary-candidates-2018", "name": "primary-candidates-2018", @@ -1035,6 +1179,18 @@ } ] }, + { + "url": "https://github.com/fivethirtyeight/redistricting-atlas-data", + "name": "redistricting-atlas-data", + "displayName": "redistricting-atlas-data", + "articles": [ + { + "date": "2018-01-25T11:00:00.000Z", + "title": "The Atlas Of Redistricting", + "url": "https://projects.fivethirtyeight.com/redistricting-maps/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/next-bechdel", "name": "next-bechdel", @@ -1464,6 +1620,37 @@ } ] }, + { + "url": "https://github.com/fivethirtyeight/uber-tlc-foil-response", + "name": "uber-tlc-foil-response", + "displayName": "uber-tlc-foil-response", + "articles": [ + { + "date": "2015-12-09T16:19:40.000Z", + "title": "Is Uber Making NYC Rush-Hour Traffic Worse?", + "rowspan": 4, + "url": "https://fivethirtyeight.com/features/is-uber-making-nyc-rush-hour-traffic-worse/" + }, + { + "date": "2015-10-13T20:44:12.000Z", + "title": "Uber Is Taking Millions Of Manhattan Rides Away From Taxis", + "rowspan": 0, + "url": "https://fivethirtyeight.com/features/uber-is-taking-millions-of-manhattan-rides-away-from-taxis/" + }, + { + "date": "2015-08-28T10:30:36.000Z", + "title": "Public Transit Should Be Uber’s New Best Friend", + "rowspan": 0, + "url": "https://fivethirtyeight.com/features/public-transit-should-be-ubers-new-best-friend/" + }, + { + "date": "2015-08-10T18:06:17.000Z", + "title": "Uber Is Serving New York’s Outer Boroughs More Than Taxis Are", + "rowspan": 0, + "url": "https://fivethirtyeight.com/features/uber-is-serving-new-yorks-outer-boroughs-more-than-taxis-are/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/tarantino", "name": "tarantino", @@ -1982,6 +2169,18 @@ } ] }, + { + "url": "https://github.com/fivethirtyeight/data/tree/master/comma-survey-data", + "name": "comma-survey-data", + "displayName": "comma-survey-data", + "articles": [ + { + "date": "2014-06-17T16:28:55.000Z", + "title": "Elitist, Superfluous, Or Popular? We Polled Americans on the Oxford Comma", + "url": "http://fivethirtyeight.com/features/elitist-superfluous-or-popular-we-polled-americans-on-the-oxford-comma/" + } + ] + }, { "url": "https://github.com/fivethirtyeight/data/tree/master/world-cup-predictions", "name": "world-cup-predictions", @@ -2151,4 +2350,4 @@ } ] } -] +] \ No newline at end of file diff --git a/examples/fiverthirtyeight-example/lib/octokit.ts b/examples/fivethirtyeight/lib/octokit.ts similarity index 100% rename from examples/fiverthirtyeight-example/lib/octokit.ts rename to examples/fivethirtyeight/lib/octokit.ts diff --git a/examples/fiverthirtyeight-example/next.config.js b/examples/fivethirtyeight/next.config.js similarity index 100% rename from examples/fiverthirtyeight-example/next.config.js rename to examples/fivethirtyeight/next.config.js diff --git a/examples/fiverthirtyeight-example/package-lock.json b/examples/fivethirtyeight/package-lock.json similarity index 99% rename from examples/fiverthirtyeight-example/package-lock.json rename to examples/fivethirtyeight/package-lock.json index 56d88147..1787d693 100644 --- a/examples/fiverthirtyeight-example/package-lock.json +++ b/examples/fivethirtyeight/package-lock.json @@ -16,6 +16,7 @@ "autoprefixer": "10.4.14", "eslint": "8.40.0", "eslint-config-next": "13.4.1", + "flexsearch": "^0.7.31", "next": "13.4.1", "next-mdx-remote": "^4.4.1", "next-seo": "^6.0.0", @@ -2610,6 +2611,11 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" }, + "node_modules/flexsearch": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.7.31.tgz", + "integrity": "sha512-XGozTsMPYkm+6b5QL3Z9wQcJjNYxp0CYn3U1gO7dwD6PAqU1SVWZxI9CCg3z+ml3YfqdPnrBehaBrnH2AGKbNA==" + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", diff --git a/examples/fiverthirtyeight-example/package.json b/examples/fivethirtyeight/package.json similarity index 96% rename from examples/fiverthirtyeight-example/package.json rename to examples/fivethirtyeight/package.json index d57cea45..3fb2bddf 100644 --- a/examples/fiverthirtyeight-example/package.json +++ b/examples/fivethirtyeight/package.json @@ -17,6 +17,7 @@ "autoprefixer": "10.4.14", "eslint": "8.40.0", "eslint-config-next": "13.4.1", + "flexsearch": "^0.7.31", "next": "13.4.1", "next-mdx-remote": "^4.4.1", "next-seo": "^6.0.0", diff --git a/examples/fiverthirtyeight-example/pages/_app.tsx b/examples/fivethirtyeight/pages/_app.tsx similarity index 100% rename from examples/fiverthirtyeight-example/pages/_app.tsx rename to examples/fivethirtyeight/pages/_app.tsx diff --git a/examples/fiverthirtyeight-example/pages/_document.tsx b/examples/fivethirtyeight/pages/_document.tsx similarity index 86% rename from examples/fiverthirtyeight-example/pages/_document.tsx rename to examples/fivethirtyeight/pages/_document.tsx index f4cf4d55..d14b36ff 100644 --- a/examples/fiverthirtyeight-example/pages/_document.tsx +++ b/examples/fivethirtyeight/pages/_document.tsx @@ -29,6 +29,16 @@ export default function Document() { +
+ +
diff --git a/examples/fiverthirtyeight-example/pages/datasets/[datasetName].tsx b/examples/fivethirtyeight/pages/datasets/[datasetName].tsx similarity index 100% rename from examples/fiverthirtyeight-example/pages/datasets/[datasetName].tsx rename to examples/fivethirtyeight/pages/datasets/[datasetName].tsx diff --git a/examples/fiverthirtyeight-example/pages/index.tsx b/examples/fivethirtyeight/pages/index.tsx similarity index 81% rename from examples/fiverthirtyeight-example/pages/index.tsx rename to examples/fivethirtyeight/pages/index.tsx index da6fcc6d..6a82521f 100644 --- a/examples/fiverthirtyeight-example/pages/index.tsx +++ b/examples/fivethirtyeight/pages/index.tsx @@ -20,28 +20,34 @@ export interface Dataset { files?: string[]; } +// Request a weekday along with a long date +const options = { + year: 'numeric', + month: 'long', + day: 'numeric', +} as const; + export function MobileItem({ dataset }: { dataset: Dataset }) { return (
- {dataset.name} + + + {dataset.name} + + {dataset.articles.map((article) => (
{article.title} - {format(article.date)} + {format(article.date).includes('years') + ? new Date(article.date).toLocaleString('en-US', options) + : format(article.date)} {' '}
))}
- - info - - {index === 0 ? dataset.name : ''} + + + {index === 0 ? dataset.name : ''} + + - + {article.title} - - {format(article.date)} - - - {index === 0 && ( - - info - - )} + + {format(article.date).includes('years') + ? new Date(article.date).toLocaleString('en-US', options) + : format(article.date)} {index === 0 && ( @@ -150,7 +154,7 @@ export default function Home({ datasets }: { datasets: Dataset[] }) {

Our Data

-

+

We’re sharing the data and code behind some of our articles and graphics. We hope you’ll use it to check our work and to create stories and visualizations of your own. @@ -164,13 +168,13 @@ export default function Home({ datasets }: { datasets: Dataset[] }) { - - - diff --git a/examples/fiverthirtyeight-example/postcss.config.js b/examples/fivethirtyeight/postcss.config.js similarity index 100% rename from examples/fiverthirtyeight-example/postcss.config.js rename to examples/fivethirtyeight/postcss.config.js diff --git a/examples/fiverthirtyeight-example/public/favicon.ico b/examples/fivethirtyeight/public/favicon.ico similarity index 100% rename from examples/fiverthirtyeight-example/public/favicon.ico rename to examples/fivethirtyeight/public/favicon.ico diff --git a/examples/fiverthirtyeight-example/public/next.svg b/examples/fivethirtyeight/public/next.svg similarity index 100% rename from examples/fiverthirtyeight-example/public/next.svg rename to examples/fivethirtyeight/public/next.svg diff --git a/examples/fiverthirtyeight-example/public/vercel.svg b/examples/fivethirtyeight/public/vercel.svg similarity index 100% rename from examples/fiverthirtyeight-example/public/vercel.svg rename to examples/fivethirtyeight/public/vercel.svg diff --git a/examples/fiverthirtyeight-example/styles/globals.css b/examples/fivethirtyeight/styles/globals.css similarity index 100% rename from examples/fiverthirtyeight-example/styles/globals.css rename to examples/fivethirtyeight/styles/globals.css diff --git a/examples/fiverthirtyeight-example/tailwind.config.js b/examples/fivethirtyeight/tailwind.config.js similarity index 100% rename from examples/fiverthirtyeight-example/tailwind.config.js rename to examples/fivethirtyeight/tailwind.config.js diff --git a/examples/fiverthirtyeight-example/tsconfig.json b/examples/fivethirtyeight/tsconfig.json similarity index 100% rename from examples/fiverthirtyeight-example/tsconfig.json rename to examples/fivethirtyeight/tsconfig.json
+ data set + related content + last updated