finished graph.js implementation