Skip to main content
100%

geoVoronoi x() and y() accessors

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

This example demonstrates a Voronoi tessellation of geographic points, where each cell is colored by a field sampled from a background image. The visualization uses `d3.geoVoronoi` to compute the voronoi diagram from a set of latitude/longitude coordinates, and the `x()` and `y()` accessors map those coordinates to pixel positions in a projected map. The code then renders the resulting polygons via `d3.geoPath` and samples a color from the underlying raster—accessed through Canvas `getImageData`—to fill each cell, effectively creating a choropleth of the image’s pixel values over the region.

AI-generated description

Similar vizzes