Commit ad2ffe75 authored by Mike Bostock's avatar Mike Bostock
Browse files


parent 08e05462
......@@ -86,14 +86,62 @@ Rather than exposing *bin*.x and *bin*.dx on each returned bin, the histogram ex
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](
## d3-axis
## Axes (d3-axis)
In place of d3.svg.axis and *axis*.orient, D3 4.0 now provides four constructors for each orientation: [d3.axisTop](, [d3.axisRight](, [d3.axisBottom](, [d3.axisLeft]( You can now pass a scale directly to the axis constructor.
To render axes in D3 3.x, you needed to not only instantiate the axis, but also style them:
.axis path,
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
.axis text {
font: 10px sans-serif;
If you forgot to style the axes, you saw this:
<img src="" width="100%" height="105">
D3 4.0 provides default styles and shorter syntax, so you can reduce all this to:
And you get this:
<img src="" width="100%" height="105">
You can still override the styles either through CSS or by modifying the axis elements. The new default axis appearance also fixes a common crisp-edges rendering issue on Safari where the axis would be drawn two-pixels thick.
* d3.svg.axis, *axis*.orient ↦ d3.axisTop, d3.axisRight, d3.axisBottom, d3.axisLeft
* add *axis*.tickArguments
* *axis*.tickSize now only takes one argument
* *axis*.innerTickSize ↦ *axis*.tickSizeInner
* *axis*.outerTickSize ↦ *axis*.tickSizeOuter
* improve the default appearance of the axis
## d3-brush
Supports Markdown
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