Skip to main content
100%

Histogram Smoothing

✓ Published0🌍 Public
CCurran Kelleher
Last edited Apr 12, 2017
Created on Apr 12, 2017

A histogram of 300 random normal samples, drawn as a smooth area chart on a Canvas, is repeatedly smoothed by a three-point moving average. Each animation frame applies one blur pass to the bin densities, causing the distribution to progressively flatten and widen toward a normal curve. The code uses d3.histogram to bin the data, d3.area with a Canvas context for rendering, and d3.timer to drive the animation, with colors cycling through hues via d3.hsl. The rainbow-like trail of strokes shows the smoothing progression over time.

AI-generated description

An experiment related to https://github.com/d3/d3-array/issues/56.

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

Built with blockbuilder.org

mit Licensed

Similar vizzes