How to get the data of a node in d3

In my pre­vi­ous arti­cle on enter, update and exit selec­tions, I dis­cussed how d3 binds data to nodes using the data() func­tion. How about the inverse case where you have a ref­er­ence to a…