d3/d3-array

Rename d3.scan to d3.leastIndex; add d3.least.

Closed this issue · 1 comments

I find d3.scan a little awkward. It feels like d3.min, but instead of an accessor, it takes a comparator, and instead of returning a value, it returns an index. This makes me wonder if we should have a method that’s like d3.scan, but that returns the least value rather than the least index.

Also, “scan” is a very generic name.

So, I propose deprecating d3.scan, and renaming it to d3.leastIndex. And introducing a new method d3.least that returns the least value according to the specified comparator.

Fixed in #108.