Published
Edited
Nov 2, 2021
3 forks
Importers
16 stars
Also listed in…
Graphs
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
delaunay = d3.geoDelaunay(points)
Insert cell
distances = delaunay.edges.map(([a, b]) => distance(points[a], points[b]))
Insert cell
distance = use_euclidian ? euclidian : d3.geoDistance
Insert cell
euclidian = (a, b) => Math.hypot(a[0] - b[0], a[1] - b[1])
Insert cell
urquhart = delaunay.urquhart(distances)
Insert cell
edges = delaunay.edges
Insert cell
urquhart_edges = edges.filter((_, i) => urquhart[i])
Insert cell
urquhart_mesh = ({
type: "MultiLineString",
coordinates: urquhart_edges.map(([i, j]) => [points[i], points[j]])
})
Insert cell
voronoi_mesh = ({
type: "MultiLineString",
coordinates: delaunay.mesh.map(([i, j]) => [
delaunay.centers[i],
delaunay.centers[j]
])
})
Insert cell
delaunay.mesh
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more