Building a force-directed graph