Plotting routines using D3.js