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

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