Public
Edited
Feb 22, 2023
Paused
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
US_counties_1920 = FileAttachment("US_county_1920_WGS84.json").json()
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
linear = d3.scaleLinear()
.domain(d3.extent(White_Rate))
.range(["#fde0dd", "#c51b8a"])
Insert cell
chart(numericSort(White_Rate), linear)
Insert cell
Insert cell
quantile = d3.scaleQuantile()
.domain(White_Rate)
.range(["#e7e1ef", "#c994c7", "#dd1c77"])
Insert cell
chart(numericSort(White_Rate), quantile)
Insert cell
Insert cell
naturalbreaks = simple.ckmeans(White_Rate, 5).map(v => v.pop())
Insert cell
jenks = d3
.scaleThreshold()
.domain(naturalbreaks)
.range(["#fde0dd", "#fa9fb5", "#c51b8a", "#dd1c77", "#8856a7"])
Insert cell
chart(numericSort(White_Rate), jenks)
Insert cell
Insert cell
quantize = d3.scaleQuantize()
.domain(d3.extent(White_Rate))
.range(["#edf8b1", "#e0f3db","#a1dab4", "#2c7fb8" , "#7bccc4"])
Insert cell
chart(numericSort(White_Rate), quantize)
Insert cell
Insert cell
threshold = d3.scaleThreshold()
.domain([0.1, 0.5, 0.64])
.range(["#f2f0f7", "#9e9ac8", "#756bb1", "#810f7c"])
Insert cell
chart(numericSort(White_Rate), threshold)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
simple = require("simple-statistics@7.0.7/dist/simple-statistics.min.js")
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