moving d3 work to separate script