This post provides a clean template for ridgeline plot with d3.js (also called joy plot). Color depends on average value, axes are labeled, and background is customized. See other examples in the ridgeline section of the gallery.
The main change is the addition of a color palette: color is now proportional to the average value of each group. Computing these means is a good example of data manipulation.