d3.js graph directive