🌍 Public
Viewing a saved revision (read-only)
efbff8efbd0945688cfd6ec40ce0ab84
#HAW: Svelte + D3: Voronoi
A Voronoi diagram partitions a 2D space into regions around 100 randomly generated points. As the mouse moves over the full-screen SVG, the first point (highlighted in yellow) updates its position to follow the cursor, dynamically redrawing the surrounding voronoi cells and circles in green. The code uses d3.Delaunay and `voronoi.renderCell` to compute and render the cells, with scales from `d3.scaleLinear` mapping the data domain to pixel coordinates.
AI-generated description