A JavaScript library for computing Voronoi diagrams and Delaunay triangulations on the surface of a sphere.
d3-geo-voronoi is a JavaScript library that adapts planar Delaunay triangulation and Voronoi diagram algorithms to work with spherical data, enabling geographic and spatial computations on a globe. It provides tools for generating spherical Voronoi tessellations, Delaunay triangulations, convex hulls, Urquhart graphs, and contour lines from spherical coordinates. The library solves the problem of performing accurate spatial analysis and visualization on spherical surfaces, such as Earth or celestial bodies, where planar projections can distort results.
This library is designed for data visualization developers and geospatial analysts working with geographic data on spherical surfaces, particularly those using the D3.js ecosystem for mapping and spatial computations. It is also suitable for researchers or engineers needing mesh generation, point location queries, or contouring for non-gridded spherical data.
Developers choose d3-geo-voronoi because it offers accurate spherical geometry computations while maintaining compatibility with D3.js, providing familiar APIs that extend planar concepts to the globe. Its dual API design allows for both high-level GeoJSON outputs for easy visualization and low-level index-based access for efficient topological computations, balancing performance and usability.
Voronoi / Delaunay tessellations on the sphere
Computes Voronoi diagrams and Delaunay triangulations directly on the sphere using stereographic projection, avoiding distortions from planar approximations, as detailed in the adaptation from d3-delaunay.
Offers both a high-level GeoJSON API (d3.geoVoronoi) for easy map visualization and a lightweight index-based API (d3.geoDelaunay) for efficient topology computations, balancing usability and performance per the README.
Includes spherical convex hull, Urquhart graph, point location queries, and contouring for non-gridded data, extending beyond basic Voronoi/Delaunay to a full suite for geographic analysis.
Maintains compatibility with D3.js by mirroring APIs of d3-voronoi and d3-delaunay, easing adoption for developers already familiar with planar D3 spatial libraries.
Does not implement .extent() and .size() methods available in d3-voronoi, limiting control over diagram bounds in visualizations, as the README acknowledges this is 'quite tricky' for spherical data.
Convex hull computation fails (returns null) for datasets covering more than a hemisphere, restricting use in global-scale analyses with widely distributed points, a noted constraint in the API reference.
Spherical adaptations introduce computational complexity compared to planar algorithms, potentially impacting performance with very large datasets, and the library requires careful handling of GeoJSON outputs versus planar arrays.
🍃 JavaScript library for mobile-friendly interactive maps 🇺🇦
An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
WebGL2 powered visualization framework
OpenLayers
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.