Put d3 code in an angular directive.