add counter from d3.js