Skip to main content
100%

Histogram Smoothing

✓ Published1🌍 Public
CCurran Kelleher
Last edited Oct 9, 2025
Created on Jun 24, 2019
Forked from Moon Calendar 2024

This visualization demonstrates how repeated iterations of a moving average smooth a histogram of 300 random normal samples into a progressively flatter curve, approximating a Gaussian filter and kernel density estimation. The code uses d3.histogram to bin the data, d3.area to render the histogram on two stacked Canvas elements, and a d3.timer to animate the blur process at 30 FPS. Each frame, the `blur` function averages each bin’s density with its neighbors, while the foreground canvas redraws the area with a semi-transparent fill and the background canvas strokes the current curve with a hue that cycles through time.

AI-generated description

Visualization of the concept of smoothing/blurring.

An experiment related to a proposed smoothing feature of d3-array.

This shows how repeated iterations of a simple moving average acts as a Gaussian Filter.

This can be used to approximate Kernel Density Estimation.

MIT Licensed

Similar vizzes