Commit 0e6d5bdc authored by Mike Bostock's avatar Mike Bostock


parent 398af057
......@@ -94,8 +94,6 @@ The [d3.range]( method no longer makes an e
The method signature for optional accessors has been changed to be more consistent with array methods such as [*array*.forEach]( the accessor is passed the current element (*d*), the index (*i*), and the array (*data*), with *this* as undefined. This affects [d3.min](, [d3.max](, [d3.extent](, [d3.sum](, [d3.mean](, [d3.median](, [d3.quantile](, [d3.variance]( and [d3.deviation]( The [d3.quantile]( method previously did not take an accessor. Some methods with optional arguments now treat those arguments as missing if they are null or undefined, rather than strictly checking arguments.length.
### Histograms
The new [d3.histogram]( API replaces d3.layout.histogram. Rather than exposing *bin*.x and *bin*.dx on each returned bin, the histogram exposes *bin*.x0 and *bin*.x1, guaranteeing that *bin*.x0 is exactly equal to *bin*.x1 on the preceeding bin. The “frequency” and “probability” modes are no longer supported; each bin is simply an array of elements from the input data, so *bin*.length is equal to D3 3.x’s *bin*.y in frequency mode. To compute a probability distribution, divide the number of elements in each bin by the total number of elements.
The *histogram*.range method has been renamed [*histogram*.domain]( for consistency with scales. The *histogram*.bins method has been renamed [*histogram*.thresholds](, and no longer accepts an upper value: *n* thresholds will produce *n* + 1 bins. If you specify a desired number of bins rather than thresholds, d3.histogram now uses [d3.ticks]( to compute nice bin thresholds. In addition to the default Sturges’ formula, D3 now implements the [Freedman-Diaconis rule]( and [Scott’s normal reference rule](
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment