A less-sophisticated alternative to Mike Bostock's Gradient Along Stroke.
Note that this version does not compute mitre joints, so sharp bends reveal the segmented nature of the "path."
xxxxxxxxxx
<html>
<head>
<script src="https://d3js.org/d3.v3.min.js"></script>
<meta charset="utf-8">
</head>
<body>
<script src="script.js"></script>
</body>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js