Published
Edited
Aug 25, 2022
Importers
11 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3.sum(states, d => d.votes)
Insert cell
R2016 = d3.sum(states, d => d[2016].electoral_R)
Insert cell
D2016 = d3.sum(states, d => d[2016].electoral_D)
Insert cell
Insert cell
Insert cell
import { electoral_votes } from "@eyeseast/fivethirtyeight-2020-forecast-data"
Insert cell
electoral_votes
Insert cell
d3.sum(Array.from(electoral_votes.values()))
Insert cell
results2016 = FileAttachment("Table 2. Electoral & Pop Vote-Table 1.csv").csv()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
blue = "#002868"
Insert cell
red = "#bf0a30"
Insert cell
gray = "lightgray"
Insert cell
height = 620
Insert cell
Insert cell
Insert cell
import { slider, select } from "@jashkenas/inputs"
Insert cell
d3 = require("d3@6")
Insert cell
fonts = html`<span></span><link href="https://fonts.googleapis.com/css2?family=Seymour+One&family=Share+Tech+Mono&family=Ubuntu+Mono:wght@400;700&display=swap" rel="stylesheet">
`
Insert cell
import { Scrubber } from "@mbostock/scrubber"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more