This post describes how to build a density chart with a dropdown button that filters the input dataset. It allows to explore the data without showing too many data on the chart, avoiding overlapping. This example works with d3.js v4
and v6
updateChart
function that update this chart with a new dataset