Published
Edited
Feb 16, 2021
Fork of Maps
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
raw_data = FileAttachment("superbowl.csv").csv()
Insert cell
Insert cell
Insert cell
formatted = new Map(d3.rollups(raw_data, v => v.length, d => d.State))
Insert cell
Insert cell
Insert cell
shapefile = d3.json("https://cdn.jsdelivr.net/npm/us-atlas@3/states-10m.json")
Insert cell
features = topojson.feature(shapefile, shapefile.objects.states).features
Insert cell
path = d3.geoPath().projection(d3.geoAlbers())
Insert cell
max_host = d3.max(d3.rollups(raw_data, v => v.length, d => d.State), d => d[1])
Insert cell
color = d3.scaleSequential(
[0, max_host],
d3.interpolateGreens
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require("d3")
Insert cell
topojson = require("topojson-client@3")
Insert cell
import { legend } from "@d3/color-legend"
Insert cell
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