JavaScript Graph Representation