Cushion Voronoi
A Voronoi diagram partitions the screen into cells, each anchored by a randomly placed site. This example renders the cells as cushioned shapes by filling each polygon with a radial gradient that transitions from white at the site’s coordinates to black at the edges, visually encoding distance from the nearest site. The gradient is defined in SVG `defs` and applied via the `fill` attribute on each `path` element. The code uses `d3.voronoi` from D3 v4 to compute the polygons and positions 20 circular site markers, with the `d3-selection-multi` plugin for setting multiple attributes at once.
AI-generated descriptionA Voronoi diagram colored with a radial gradient centered on each cell's site. The luminance of each point is proportional to the cost of reaching the nearest site (the darker the color, the higher the cost).
forked from <a href='http://bl.ocks.org/nitaku/'>nitaku</a>'s block: <a href='http://bl.ocks.org/nitaku/dd611c0e4dae1d38eab67aedae7ac44f'>Cushion Voronoi</a>