Looking for a small and easy to follow strokes example? You've found it.
A fork and port of mike's js version (gist/block), for the strokes examples repo.
(merge requests should go to the example in the repo).
The Voronoi layout, d3.geom.voronoi, does not provide clipping by default; the returned diagram spans ±1e6. This example demonstrates how to clip the diagram to known dimensions.
xxxxxxxxxx
<meta charset="utf-8">
<title>voronoi-clipping</title>
<style>
circle,
path {
stroke: #000;
}
path {
fill-opacity: .1;
}
path:hover {
fill-opacity: .2;
}
</style>
<body>
<script type="text/javascript" src="https://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="voronoi-clipping.js"></script>
</body>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js