Public
Edited
Jan 30
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
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
normalData = Float64Array.from({ length: n }, d3.randomNormal())
Insert cell
uniformData = Float64Array.from({ length: n }, d3.randomUniform())
Insert cell
Insert cell
Insert cell
compData = compDist == "Normal" ? normalData : uniformData
Insert cell
Insert cell
scaledCompData = normalizeMinMax(compData)
Insert cell
Insert cell
Insert cell
Insert cell
normalizeMinMax = (data) => {
const ext = d3.extent(data);
const scale = d3.scaleLinear().domain(ext);
return data.map((d) => scale(d));
}
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