This repository implements Steven Fortune’s algorithm (sweep-line method) for generating Voronoi diagrams in JavaScript, providing a performant browser-side solution for computational geometry of planar point sets. With this library you can feed a set of sites (points) and compute their Voronoi cells – the partition of the plane into regions closest to each site – in O(n log n) time. It’s especially useful in web UIs, visualizations, interactive maps, and generative-art contexts where you need dynamic tessellations or diagrammatic layouts. The library exposes API functions for computing cells, retrieving neighbors, and drawing results into canvas or SVG. Because it is pure JavaScript and self-contained, it integrates easily with browser or Node.js applications without heavy dependencies. For developers exploring spatial algorithms, generative UI, or interactive diagrams, this codebase is a practical reference and tool to build upon.
Features
- Implementation of Fortune’s algorithm for Voronoi diagram generation in JavaScript
- API to compute cells from given sites and retrieve adjacency/neighbor information
- Rendering support for canvas or SVG to visualize output
- Lightweight, dependency-free code able to run in browser or Node.js contexts
- Useful for spatial layout, generative art, GIS, or interactive diagrams
- Open code to inspect, extend or integrate into custom visualization pipelines