This post describes how to build a mirror density chart in d3.js. Two variables are represented face to face. This kind of chart can be handy to compare 2 variables that have overlapping distribution. It is often used to compare sexes for instance. This example works with d3.js v4
and v6
filter()
function. See more on data manipulation. Density is estimated and plotted for each part.