Published
Edited
Dec 13, 2019
Fork of Choropleth
1 star
Insert cell
Insert cell
Insert cell
Insert cell
data_arr = d3.csvParse(await FileAttachment("rent2020@1.csv").text(), ({fips2010, bedrooms, rent}) => ({ fips2010, bedrooms: +bedrooms, rent: +rent })).filter((d) => d.bedrooms == bedrooms)
Insert cell
data = Object.assign(new Map(data_arr.map(({fips2010, rent}) => [fips2010, rent])), {title: "Median Rent"})
Insert cell
color = d3.scaleSequential(d3.extent(Array.from(data.values())), d3.interpolateBlues)
Insert cell
path = d3.geoPath()
Insert cell
format = d => `$${d}`
Insert cell
states = new Map(us.objects.states.geometries.map(d => [d.id, d.properties]))
Insert cell
us = FileAttachment("counties-albers-10m.json").json()
Insert cell
topojson = require("topojson-client@3")
Insert cell
d3 = require("d3@5")
Insert cell
import {legend} from "@d3/color-legend"
Insert cell
import {radio} from "@jashkenas/inputs"
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