Skip to main content
100%

Hexagonal Binning in d3v4

✓ Published0🌍 Public
PPhilippe Rivière
Last edited Jul 2, 2016
Created on Jun 29, 2016

Hexagonal binning visualizes 2,000 normally distributed random points by grouping them into uniform hexagons. The color of each hexagon encodes the count of points falling within it, transitioning from white to steel blue through a linear color scale. The visualization uses the d3.hexbin plugin to compute bin positions and the hexagon path, while d3.scaleLinear with interpolateLab drives the color mapping. Axes are generated with d3.axisBottom and d3.axisLeft on an SVG canvas.

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; color encodes the number of points that fall into each bin. You can also use area 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/4248145'>Hexagonal Binning</a>

gpl-3.0 Licensed

Similar vizzes