This is a copy of work done by Jason Davies that demonstrates use of science.js. It is posted here simply so it can be studied. The original example code can be found at science.js/examples/kde. Slight modifications were made so it displays well on bl.ocks.org.
https://d3js.org/d3.v3.min.js