Commit 7c8abc09 authored by Mike Bostock's avatar Mike Bostock
Browse files

Remote delaunay example.

Replaced by <http://bl.ocks.org/4341156>.
parent c9629d47
<!DOCTYPE html>
<meta charset="utf-8"> <title>Delaunay Triangulation</title>
<script src="../../d3.js"></script>
<style>
@import url("../../lib/colorbrewer/colorbrewer.css");
path {
stroke: #000;
stroke-width: .5px;
}
</style>
<body>
<script>
var width = 960,
height = 500;
var vertices = d3.range(500).map(function(d) {
return [Math.random() * width, Math.random() * height];
});
var svg = d3.select("body")
.append("svg")
.attr("width", width)
.attr("height", height)
.attr("class", "PiYG");
svg.append("g")
.selectAll("path")
.data(d3.geom.delaunay(vertices))
.enter().append("path")
.attr("class", function(d, i) { return "q" + (i % 9) + "-9"; })
.attr("d", function(d) { return "M" + d.join("L") + "Z"; });
</script>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment