clean up d3 code for viewing nodes