This post describes how to smoothly transition between groups in a line chart with d3.js. It is very close from this other example. Here groups values are stored in the same column instead of having one distinct column each. It is the tidy or long format versus the previous wide or untidy format.
update()
function is created. It smoothly transforms the chart with the value of another columnselect
button is changed.