Skip to main content
100%

#HAW: Svelte + D3: Voronoi

✓ Published1🌍 Public
MMatthias Stahl
Last edited Nov 28, 2025
Created on Nov 28, 2025

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
MIT Licensed

Similar vizzes