implementing d3 graph