coffeescript for graph functionality