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."
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js