Hexagonal Binning (Area)
✓ Published0🌍 Public
Mmbostock
Last edited Oct 22, 2018
Created on Dec 10, 2012
Two thousand normally distributed random points are aggregated into hexagonal bins, where the area of each hexagon encodes the number of points it contains. The visualization uses the `d3-hexbin` plugin’s `d3.hexbin()` to bin the data and `hexbin.hexagon()` to generate the SVG path for each bin, with `d3.scaleSqrt` mapping bin counts to radius. Axes are drawn with `d3.axisLeft` and `d3.axisBottom`, and the rendering is clipped to the plotting area via an SVG `clipPath`.
AI-generated descriptionThis 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.
gpl-3.0 Licensed