add graph to d3 created svg element