Helpers for building graphs with d3