D3's enter() and exit(): Under the Hood

Here we explore the .enter() and .exit() functions of D3. The reader is encouraged to follow each step and then to explore.

Below are some div elements (coloured blue-grey). Below that is a JavaScript array myData representing your data. You can randomise, add or remove values of myData.

Peter Cook (2014)