Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
histogram: deal with the degenerate domain without throwing an except…
…ion. 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 <[email protected]>
- Loading branch information