source code from d3js library