mbostock/d3 — pull request #1961 by jonsadka (2014-08-03 19:58:50+00:00)
Title: Add d3.shuffle(array[, i0[, i1]]). Fixes #1865.

Adds ability to shuffle for a subset of an array. First argument in shuffle is the array, second argument is the desired starting index and i1 is the desired ending index.

If shuffle(array): Shuffle operates on the entire array.
If shuffle(array, i0): Shuffle operates on the array starting at index i0 and continues for the remainder of the array.
If shuffle(array, i0, i1) and i0 < i1: Shuffle operate on the array starting at index i1 and continues until index i1.
If shuffle(array, i0, i1) and i0 >= i1: Shuffle operate on the array starting at index 0 and continues until index i1.
If shuffle(array, i0, i1) and either i0 or i1 are < 0: Shuffle does not operate correctly and substitutes undefined at some indices in the array.