Force-directed graph helper for d3.js