added d3 mapping function