Getting ready to move the d3 logic into a angular factory.