Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

#HAW: Svelte + D3: Voronoi

Public visualization

Viewing a saved revision (read-only)

0442d3c1132847608a97c99a83e57817

#HAW: Svelte + D3: Voronoi

0 stars1🌍 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