add d3.js function but not ok