move d3 js to layout