A little refactoring of graph-directives.js + graph.css