Skip to main content
100%

Hexagonal Binning (Area) d3v4

✓ Published0🌍 Public
PPhilippe Rivière
Last edited Dec 19, 2016
Created on Dec 19, 2016

A hexagonal binning visualization renders 2,000 randomly generated points from a normal distribution into hexagons of varying size. The area of each hexagon encodes the number of points falling within it, using a square-root scale to map bin counts to hexagon radii. The example uses the d3.hexbin plugin to group points, with SVG paths drawn for each hexagon and clipped to the plot area. Axes are generated using d3.axisBottom and d3.axisLeft, while the random point distribution relies on d3.randomNormal.

AI-generated description

This example shows how to use the d3.hexbin plugin for hexagonal binning. 2,000 random points with a normal distribution are binned into hexagons; area encodes the number of points that fall into each bin. You can also use color encoding. Inspired by earlier work by Zachary Forest Johnson.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/4248146'>Hexagonal Binning (Area)</a>

gpl-3.0 Licensed

Similar vizzes