D3.js kind of functional