mbostock/d3 — pull request #602 by jonseymour (2012-03-23 12:35:49+00:00)
Title: histogram: deal with the degenerate domain without throwing an exception.

A histogram with a domain that has an extent of exactly 0 currently causes
the generated histogram to barf with an "undefined does not have .y" exception.

In order to avoid clients having to special case this degenerate case, modified
the loop so that the empty array is returned instead, in this case.

try {
var
scale=d3.scale.linear().domain([0,0]);

d3.layout.histogram().bins(scale.ticks(3))([0]);
console.log("ok");
} catch (e) {
console.log("failed");
throw e;
}

Signed-off-by: Jon Seymour