Skip to main content
100%

Voronoi binning (animated)

✓ Published0🌍 Public
PPhilippe Rivière
Last edited Sep 18, 2016
Created on Sep 18, 2016

Four thousand random points are colored by size, with the largest ten percent becoming Voronoi sites. The animation cycles through stages: it sorts points by size, uses the top ten percent as sites for d3.voronoi, then assigns every point the color of its site’s cell via the customized `diagram.find()` method. Points and cells fade, recolor, and reset every nine seconds using d3.interval and transitions.

AI-generated description

Group data points around the largest points.

The recipe is as follows:

  1. sort data points according to their sizes (here size = d[3])

  2. use top 10% points as Voronoi sites

  3. bin all data points according to their Voronoi cell, using <a href='http://bl.ocks.org/Fil/1b7ddbcd71454d685d1259781968aefc'>voronoi.find()</a>. The binning is rendered by using the Voronoi sites's color.

See also the <a href="//bl.ocks.org/Fil/7c3c41f1524dcf2caea54290cceddf0a">static version</a> — much less code to parse!

Original work by Philippe Rivière for d3-voronoi (issue 17).

gpl-3.0 Licensed

Similar vizzes