d3 graph function
wip