Releases: d3/d3
3.0.2
- Fix circle.origin.
- Fix path.bounds for projections that do not implement projection.stream.
3.0.1
- Fix treemap.mode "slice-dice".
- Fix d3.geo.centroid for mixed geometry types.
- Fix d3.geo.stream for nested GeometryCollections.
3.0 “Baja”
The page covers new features in 3.0; see Upgrading to 3.0 for how to migrate from 2.x to 3.0.
Geo
D3 includes a powerful new geographic projection system! Whereas previous versions of D3 only understood projections as point functions, D3 3.0 models projections as full geometry transformations. Thus, when straight lines are projected to curves, D3 applies configurable adaptive resampling to subdivide lines and eliminate projection artifacts; see for example the smooth appearance of Antarctica in the Larrivée and Van der Grinten projections. When lines or polygons cross the antimeridian, D3 cuts the geometry, rather than relying on pre-cut shapefiles. All projections now support small circle clipping and three-axis rotation.
Under the hood, D3 uses streaming geometry transformations (d3.geo.stream) that reduce memory by avoiding temporary objects. This design also enables direct-to-canvas rendering with dramatic performance improvements! Streams are used to compute projected area, centroid and bounds consistent with displayed geometry, and can even filter geometry for scale-dependent shape simplification.
The d3.geo package includes a number of useful new components, such as a graticule for displaying grid lines and sphere rendering for globe outlines. The d3.geo.circle class now supports small and great circle rendering, so you can approximate Tissot's indicatrix. A new d3.geo.interpolate simplifies interpolation of spherical coordinates along great arcs, and there are even new functions for accurately computing spherical area, centroid and bounds.
Plugins
Peirce Quincuncial |
Wagner VI |
Equidistant Conic |
Mollweide |
Sinu-Mollweide |
Goode Homolosine |
Van der Grinten |
d3.hexbin |
d3.geo.tile |
TopoJSON |
Map Coloring |
Smooth Zooming |
The extended geographic projections plugin brings the number of supported projections to over 40! You can also compose new custom projections using d3.geo.projection and d3.geo.projectionMutator. The d3.geo.tile plugin makes it easy to drop-in 256x256 raster tiles into your map visualization. In conjunction with d3.behavior.zoom, you can quickly create slippy maps. The d3.hexbin and d3.interpolateZoom plugins are also useful for mapping.
TopoJSON is an extension to GeoJSON that typically provides 80-90% smaller file sizes. It also encodes topology, enabling topology-preserving shape simplification (à la MapShaper), map coloring, cartograms, boundary mesh computation, and more! TopoJSON is not a D3 plugin per se, but simply a standalone JavaScript library for converting TopoJSON to GeoJSON; a future release of d3.geo may add native TopoJSON support.
Transitions
Chained Transitions, I |
Chained Transitions, II |
Chained Transitions, III |
Chained Transitions, IV |
Transition Reselection, I |
Transition Reselection, II |
D3’s transitions now bind tweens and other transition state to the DOM, similar to how data is bound to selections. This means you can now reselect scheduled transitions from the DOM and modify them, say for customized axes. You can also inspect them in the JavaScript console for easier debugging.
To make transitions easier to use, value functions are now evaluated immediately by transition.attr and transition.style, rather than waiting until the transition starts. This greatly simplifies chained transitions that depend on external state, such as scale domains. The transition.transition method now creates a transition that starts when the previous transition ends (rather than a concurrent transition), so you can chain transitions without listening for "end" events.
For more on how transitions work in D3, see the Working with Transitions tutorial, and the section on transitions in Upgrading to 3.0.
Requests
Progress Events |
2.10.0
- Add multi-valued map support for selection.attr and similar methods.
- Add Lab* and HCL color spaces.
- Add d3.tween for easier customization of transition interpolators.
- Add d3.tsv for loading tab-separated values.
- Add static localization for d3.time.format, including fr_FR and ru_RU locales.
- Add a new quantitative scale: d3.scale.threshold.
- Add outer padding support for d3.scale.ordinal’s rangeBands.
- Add d3.layout.pack padding support.
- Custom interpolators can now be used with d3.svg.line and d3.svg.area.
- Add new random generators for log-normal and Irwin–Hall distributions.
- Improve d3.time.scale’s nice.
- Fix incorrect tangents with monotone interpolation.
- Simplify transform interpolation.
2.9.0
2.8.0
- Add selection.datum (deprecating selection.map), which is like selection.data but doesn't compute a data-join; it can be used to get or set the data bound to elements.
- Brush component can now take decorative resizers.
- Add d3.map class (similar to ES6's map collection) for easier management of string-value maps; this is used internally by transitions, event listeners, the nest operator, and many other components.
- Add d3.bisector for bisecting sorted arrays with an accessor.
- Expose d3.selection.enter.prototype.
- Generalize d3.svg.mouse to support HTML elements, and renamed to d3.mouse.
- Add d3.scale.identity.
- Add axis.tickValues.
- Rewrite d3.behavior.zoom.
- Add "start" and "end" events to force layout, along with force.tick and force.alpha for synchronous execution.
- Add a variety of new time interval methods.