Published
Edited
Sep 1, 2020
Importers
3 stars
Insert cell
Insert cell
national_toplines = d3.csv("https://projects.fivethirtyeight.com/2020-general-data/presidential_national_toplines_2020.csv", d3.autoType)
Insert cell
state_toplines = d3.csv("https://projects.fivethirtyeight.com/2020-general-data/presidential_state_toplines_2020.csv", row => ({
...d3.autoType(row),
modeldate: row.modeldate, // autoType breaks this
ev: electoral_votes.get(row.state),
}))
Insert cell
presidential_ev_probabilities = d3.csv("https://projects.fivethirtyeight.com/2020-general-data/presidential_ev_probabilities_2020.csv", d3.autoType)
Insert cell
presidential_scenario_analysis = d3.csv("https://projects.fivethirtyeight.com/2020-general-data/presidential_scenario_analysis_2020.csv", d3.autoType)
Insert cell
economic_index = d3.csv("https://projects.fivethirtyeight.com/2020-general-data/economic_index.csv", d3.autoType)
Insert cell
Insert cell
electoral_votes = d3.csvParse(await FileAttachment("Electoral College 2020 - Sheet1.csv").text()).reduce((m, d) => {
m.set(d.state, +d.votes);
return m;
}, new Map())
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more