basic d3 code