Public
Edited
Jun 20, 2023
1 fork
1 star
D3 Distributions
Histogram bin width vs content frequency
Comparing Binned Distributions
Also listed in…
Plot
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = d3.range(n).map((d, i) => ({ d, i }))
Insert cell
getThresholds = (data, bins) => {
const dataRange = d3.extent(data); //, (d) => d.d)
const binWidth = (dataRange[1] - dataRange[0] + 0.00001) / bins;
return d3.range(bins + 1).map((d) => d * binWidth);
}
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