Using d3-voronoi on a torus.
The solution is to have height copies of each site, on N, NW, W, etc., using the cylinder technique twice.
The n
first cells and n
first sites are the originals.
We add a shadow
property to copies of sites, and filter out links that have only shadow copies.
Made by Philippe Rivière from mbostock's block: Canvas Voronoi
https://d3js.org/d3.v4.min.js