Published
Edited
Jun 18, 2021
Importers
6 stars
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
colorScaleHigh = d3.scaleThreshold([high], [gray, scheme[2]])
Insert cell
colorScaleMedium = d3.scaleThreshold([low, high], [gray, scheme[1], gray])
Insert cell
colorScaleLow = d3.scaleThreshold([low], [scheme[0], gray])
Insert cell
colorScaleAll = d3.scaleThreshold([low, high], scheme)
Insert cell
scheme = d3.schemeReds[3]
Insert cell
gray = "#ccc"
Insert cell
low = d3.quantileSorted(sortedWithout, 0.1)
Insert cell
high = d3.quantileSorted(sortedWithout, 0.9)
Insert cell
median = d3.quantileSorted(sortedWithout, 0.5)
Insert cell
data.filter((d) => d.value < low).length
Insert cell
data.filter((d) => d.value > high).length
Insert cell
legendModified = {
const l = legend({
color: colorScaleAll,
tickFormat: ".0%",
tickValues: [0, 0.11, 0.33, 0.75],
// ticks: 5,
title: "Ratio of households without internet access",
width: 210
});

d3.select(l);

return l;
}
Insert cell
Insert cell
Insert cell
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