Implementation in D3.js