This animation demonstrates the selection sort.
The main problem was to chain was to chain transition. I was doing a data join at every iteration, which discarded my current transition.
Instead, i just chained transition, and acceded the current state of the array in the transition.
Array is shuffled at the end of the algorithm. Note the filter() call on the transitions. Without the filter, sort() function would be called ten times, as there is ten .rect elements.
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js