add a d3 factory (Note this will have to be redone tomorrow)