Updating path based on a list of integers using d3.js
(The path is being generated by including one value at a time)