.domain([d3.min(pctblack),d3.max(pctblack)])// can use d3.extent() for .domain as well
.range(["#efedf5","#756bb1"])// get colors from ColorBrewer(website) in HEX format
chart(numericSort(pctblack),linear)
md`# Quantile Classification`
quantile=d3.scaleQuantile()
.domain(pctblack)
.range(["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"])
chart(numericSort(pctblack),quantile)
md`# Jenks Natural Breaks Classification`
naturalbreaks=simple.ckmeans(pctblack,4).map(v=>v.pop())//naturalbreaks will decide where the breaks in your data should be depending on how many classes you want
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.