The Delaunay triangulation, the dual of Voronoi tesselation, creates a planar, triangular mesh for a given set of points. This example updates the Delaunay triangulation in response to mouse interaction! Colors by Cynthia Brewer; algorithm by Steven Fortune; implementation based on work by Nicolas Garcia Belmonte; interaction inspired by Raymond Hill.
View index.html
<html> | |
<head> | |
<!-- Load the d3 library. --> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> | |
<style> | |
body { font-family: "Open Sans"; } | |
text.stateID { dominant-baseline: middle; text-anchor: middle; } | |
</style> | |
</head> |